Skip to content

Issue a device credential for another organization

POST
/v2/organizations/switch
curl --request POST \
--url https://api.runta.com/v2/organizations/switch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "organization": "example" }'
Media typeapplication/json
object
organization
required

Organization id or slug.

string
Examplegenerated
{
"organization": "example"
}

Switched organization.

Media typeapplication/json
object
data
required
object
access_token
required
string
token_type
required
string
expires_in
required
integer
organization_id
required
string
name
required
string
slug
required
string
Examplegenerated
{
"data": {
"access_token": "example",
"token_type": "example",
"expires_in": 1,
"organization_id": "example",
"name": "example",
"slug": "example"
}
}

Missing, malformed, or rejected bearer token

Media typeapplication/json
object
error
required
object
authorization_reason

Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.

string
code
required
string
Allowed values: already_exists command_failed deadline_exceeded failed_precondition FEATURE_TEMPORARILY_DISABLED internal invalid_argument not_found permission_denied tenant_blocked rate_limited unauthenticated unavailable unimplemented
message
required
string
request_id
required

UUID v7 correlation ID shared with the X-Request-Id response header.

string
Example
{
"error": {
"code": "already_exists"
}
}

The bearer token is not allowed to perform this action

Media typeapplication/json
object
error
required
object
authorization_reason

Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.

string
code
required
string
Allowed values: already_exists command_failed deadline_exceeded failed_precondition FEATURE_TEMPORARILY_DISABLED internal invalid_argument not_found permission_denied tenant_blocked rate_limited unauthenticated unavailable unimplemented
message
required
string
request_id
required

UUID v7 correlation ID shared with the X-Request-Id response header.

string
Example
{
"error": {
"code": "already_exists"
}
}

The requested resource was not found

Media typeapplication/json
object
error
required
object
authorization_reason

Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.

string
code
required
string
Allowed values: already_exists command_failed deadline_exceeded failed_precondition FEATURE_TEMPORARILY_DISABLED internal invalid_argument not_found permission_denied tenant_blocked rate_limited unauthenticated unavailable unimplemented
message
required
string
request_id
required

UUID v7 correlation ID shared with the X-Request-Id response header.

string
Example
{
"error": {
"code": "already_exists"
}
}

The request conflicts with current resource state

Media typeapplication/json
object
error
required
object
authorization_reason

Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.

string
code
required
string
Allowed values: already_exists command_failed deadline_exceeded failed_precondition FEATURE_TEMPORARILY_DISABLED internal invalid_argument not_found permission_denied tenant_blocked rate_limited unauthenticated unavailable unimplemented
message
required
string
request_id
required

UUID v7 correlation ID shared with the X-Request-Id response header.

string
Example
{
"error": {
"code": "already_exists"
}
}

Validation or application error

Media typeapplication/json
object
error
required
object
authorization_reason

Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.

string
code
required
string
Allowed values: already_exists command_failed deadline_exceeded failed_precondition FEATURE_TEMPORARILY_DISABLED internal invalid_argument not_found permission_denied tenant_blocked rate_limited unauthenticated unavailable unimplemented
message
required
string
request_id
required

UUID v7 correlation ID shared with the X-Request-Id response header.

string
Example
{
"error": {
"code": "already_exists"
}
}

Rate limit exceeded

Media typeapplication/json
object
error
required
object
authorization_reason

Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.

string
code
required
string
Allowed values: already_exists command_failed deadline_exceeded failed_precondition FEATURE_TEMPORARILY_DISABLED internal invalid_argument not_found permission_denied tenant_blocked rate_limited unauthenticated unavailable unimplemented
message
required
string
request_id
required

UUID v7 correlation ID shared with the X-Request-Id response header.

string
Example
{
"error": {
"code": "already_exists"
}
}

Operation is not implemented

Media typeapplication/json
object
error
required
object
authorization_reason

Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.

string
code
required
string
Allowed values: already_exists command_failed deadline_exceeded failed_precondition FEATURE_TEMPORARILY_DISABLED internal invalid_argument not_found permission_denied tenant_blocked rate_limited unauthenticated unavailable unimplemented
message
required
string
request_id
required

UUID v7 correlation ID shared with the X-Request-Id response header.

string
Example
{
"error": {
"code": "already_exists"
}
}

Upstream service is unavailable

Media typeapplication/json
object
error
required
object
authorization_reason

Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.

string
code
required
string
Allowed values: already_exists command_failed deadline_exceeded failed_precondition FEATURE_TEMPORARILY_DISABLED internal invalid_argument not_found permission_denied tenant_blocked rate_limited unauthenticated unavailable unimplemented
message
required
string
request_id
required

UUID v7 correlation ID shared with the X-Request-Id response header.

string
Example
{
"error": {
"code": "already_exists"
}
}

Upstream request timed out

Media typeapplication/json
object
error
required
object
authorization_reason

Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.

string
code
required
string
Allowed values: already_exists command_failed deadline_exceeded failed_precondition FEATURE_TEMPORARILY_DISABLED internal invalid_argument not_found permission_denied tenant_blocked rate_limited unauthenticated unavailable unimplemented
message
required
string
request_id
required

UUID v7 correlation ID shared with the X-Request-Id response header.

string
Example
{
"error": {
"code": "already_exists"
}
}

Error response

Media typeapplication/json
object
error
required
object
authorization_reason

Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.

string
code
required
string
Allowed values: already_exists command_failed deadline_exceeded failed_precondition FEATURE_TEMPORARILY_DISABLED internal invalid_argument not_found permission_denied tenant_blocked rate_limited unauthenticated unavailable unimplemented
message
required
string
request_id
required

UUID v7 correlation ID shared with the X-Request-Id response header.

string
Example
{
"error": {
"code": "already_exists"
}
}