Skip to content

Consume magic link

POST
/v1/auth/magic-link/consume
curl --request POST \
--url https://example.com/v1/auth/magic-link/consume \
--header 'Content-Type: application/json' \
--data '{ "token": "example" }'

Exchanges a magic-link token (issued via the /v1/user/{sid}/magic-link/request admin handoff) for a session token.

Media typeapplication/json
object
token
required
string
Examplegenerated
{
"token": "example"
}

OK

Media typeapplication/json
object
session_token
required
string
user_sid
required
string
account_sid
required
string
tenant_sid
required
string
email
required
string
Examplegenerated
{
"session_token": "example",
"user_sid": "example",
"account_sid": "example",
"tenant_sid": "example",
"email": "example"
}

Invalid request body or parameters

Media typeapplication/json
object
error
required

Stable lower_snake_case usecase code (e.g. scenario_not_found)

string
code
required

Registered machine code — generic ERRxxx by status class (ERR001–ERR020 reserved); entity-prefixed codes (SCN1xx) appear only inside validation details; registry in docs/specifications/error-envelope-design.md, append-only, never renumbered

string
message
required
string
data

Structured details, present only where there is structure to carry: validation failures (topic validation, per-entity errors) and delete conflicts (topic conflict, referencing agents)

object
topic
string
errors

Validation errors keyed by entity

object
scenario
Array<object>
object
code

SCN1xx constructor validation code

string
message
string
summary
string
tree_id
string
node_id
string
output_type
string
duplicate_tree_index
string
duplicate_node_index
string
property
string
invalid_value
string
agents

Ids of the agents referencing the resource a delete was rejected for; first 20 — message carries the total count

Array<string>
Examplegenerated
{
"error": "example",
"code": "example",
"message": "example",
"data": {
"topic": "example",
"errors": {
"scenario": [
{
"code": "example",
"message": "example",
"summary": "example",
"tree_id": "example",
"node_id": "example",
"output_type": "example",
"duplicate_tree_index": "example",
"duplicate_node_index": "example",
"property": "example",
"invalid_value": "example"
}
]
},
"agents": [
"example"
]
}
}

Missing or invalid credentials

Media typeapplication/json
object
error
required

Stable lower_snake_case usecase code (e.g. scenario_not_found)

string
code
required

Registered machine code — generic ERRxxx by status class (ERR001–ERR020 reserved); entity-prefixed codes (SCN1xx) appear only inside validation details; registry in docs/specifications/error-envelope-design.md, append-only, never renumbered

string
message
required
string
data

Structured details, present only where there is structure to carry: validation failures (topic validation, per-entity errors) and delete conflicts (topic conflict, referencing agents)

object
topic
string
errors

Validation errors keyed by entity

object
scenario
Array<object>
object
code

SCN1xx constructor validation code

string
message
string
summary
string
tree_id
string
node_id
string
output_type
string
duplicate_tree_index
string
duplicate_node_index
string
property
string
invalid_value
string
agents

Ids of the agents referencing the resource a delete was rejected for; first 20 — message carries the total count

Array<string>
Examplegenerated
{
"error": "example",
"code": "example",
"message": "example",
"data": {
"topic": "example",
"errors": {
"scenario": [
{
"code": "example",
"message": "example",
"summary": "example",
"tree_id": "example",
"node_id": "example",
"output_type": "example",
"duplicate_tree_index": "example",
"duplicate_node_index": "example",
"property": "example",
"invalid_value": "example"
}
]
},
"agents": [
"example"
]
}
}

Internal server error

Media typeapplication/json
object
error
required

Stable lower_snake_case usecase code (e.g. scenario_not_found)

string
code
required

Registered machine code — generic ERRxxx by status class (ERR001–ERR020 reserved); entity-prefixed codes (SCN1xx) appear only inside validation details; registry in docs/specifications/error-envelope-design.md, append-only, never renumbered

string
message
required
string
data

Structured details, present only where there is structure to carry: validation failures (topic validation, per-entity errors) and delete conflicts (topic conflict, referencing agents)

object
topic
string
errors

Validation errors keyed by entity

object
scenario
Array<object>
object
code

SCN1xx constructor validation code

string
message
string
summary
string
tree_id
string
node_id
string
output_type
string
duplicate_tree_index
string
duplicate_node_index
string
property
string
invalid_value
string
agents

Ids of the agents referencing the resource a delete was rejected for; first 20 — message carries the total count

Array<string>
Examplegenerated
{
"error": "example",
"code": "example",
"message": "example",
"data": {
"topic": "example",
"errors": {
"scenario": [
{
"code": "example",
"message": "example",
"summary": "example",
"tree_id": "example",
"node_id": "example",
"output_type": "example",
"duplicate_tree_index": "example",
"duplicate_node_index": "example",
"property": "example",
"invalid_value": "example"
}
]
},
"agents": [
"example"
]
}
}