Issue a device credential for another organization
const url = 'https://api.runta.com/v2/organizations/switch';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"organization":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.runta.com/v2/organizations/switch \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "organization": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Organization id or slug.
Examplegenerated
{ "organization": "example"}Responses
Section titled “Responses”Switched organization.
object
object
Examplegenerated
{ "data": { "access_token": "example", "token_type": "example", "expires_in": 1, "organization_id": "example", "name": "example", "slug": "example" }}Missing, malformed, or rejected bearer token
object
object
Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}The bearer token is not allowed to perform this action
object
object
Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}The requested resource was not found
object
object
Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}The request conflicts with current resource state
object
object
Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}Validation or application error
object
object
Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}Rate limit exceeded
object
object
Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}Operation is not implemented
object
object
Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}Upstream service is unavailable
object
object
Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}Upstream request timed out
object
object
Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}default
Section titled “default”Error response
object
object
Authorization refusal reason. Only required_scope_missing permits an OAuth scope challenge.
UUID v7 correlation ID shared with the X-Request-Id response header.
Example
{ "error": { "code": "already_exists" }}