Get organization user
Returns a user in your organization.
GET
/
organizations
/
users
/
{id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const user = await client.organizations.users.retrieve('id');
console.log(user.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
user = client.organizations.users.retrieve(
id="id",
)
print(user.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
user, err := client.Organizations.Users.Get(
context.TODO(),
"id",
telnyx.OrganizationUserGetParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", user.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.organizations.users.UserRetrieveParams;
import com.telnyx.sdk.models.organizations.users.UserRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
UserRetrieveResponse user = client.organizations().users().retrieve("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
user = telnyx.organizations.users.retrieve("id")
puts(user)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$user = $client->organizations->users->retrieve('id', includeGroups: true);
var_dump($user);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx organizations:users retrieve \
--api-key 'My API Key' \
--id idcurl --request GET \
--url https://api.telnyx.com/v2/organizations/users/{id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "organization_sub_user",
"email": "user@example.com",
"user_status": "enabled",
"organization_user_bypasses_sso": false,
"created_at": "2018-02-02T22:25:27.521Z",
"last_sign_in_at": "2018-02-02T22:25:27.521Z"
}
}{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "The request failed because it was not well-formed.",
"source": {
"pointer": "/"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not understand the provided credentials.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "10010",
"title": "Not authorized",
"detail": "You are not authorized to access the requested resource.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10010"
},
"source": {
"pointer": "/"
}
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "The requested resource or URL could not be found.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10005"
},
"source": {
"pointer": "/"
}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Organization User ID
Query Parameters
When set to true, includes the groups array for each user in the response. The groups array contains objects with id and name for each group the user belongs to.
Response
Successful response with details about an Organization User.
Show child attributes
Show child attributes
Example:
{ "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58", "record_type": "organization_sub_user", "email": "user@example.com", "user_status": "enabled", "organization_user_bypasses_sso": false, "created_at": "2018-02-02T22:25:27.521Z", "last_sign_in_at": "2018-02-02T22:25:27.521Z" }
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const user = await client.organizations.users.retrieve('id');
console.log(user.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
user = client.organizations.users.retrieve(
id="id",
)
print(user.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
user, err := client.Organizations.Users.Get(
context.TODO(),
"id",
telnyx.OrganizationUserGetParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", user.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.organizations.users.UserRetrieveParams;
import com.telnyx.sdk.models.organizations.users.UserRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
UserRetrieveResponse user = client.organizations().users().retrieve("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
user = telnyx.organizations.users.retrieve("id")
puts(user)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$user = $client->organizations->users->retrieve('id', includeGroups: true);
var_dump($user);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx organizations:users retrieve \
--api-key 'My API Key' \
--id idcurl --request GET \
--url https://api.telnyx.com/v2/organizations/users/{id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "organization_sub_user",
"email": "user@example.com",
"user_status": "enabled",
"organization_user_bypasses_sso": false,
"created_at": "2018-02-02T22:25:27.521Z",
"last_sign_in_at": "2018-02-02T22:25:27.521Z"
}
}{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "The request failed because it was not well-formed.",
"source": {
"pointer": "/"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not understand the provided credentials.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "10010",
"title": "Not authorized",
"detail": "You are not authorized to access the requested resource.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10010"
},
"source": {
"pointer": "/"
}
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "The requested resource or URL could not be found.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10005"
},
"source": {
"pointer": "/"
}
}
]
}