Skip to content

Invite to workspace

Viewing v1, superseded by v2

POST
/v1/workspaces/{workspace_id}/invites
curl --request POST \
--url https://api.app.layer.ai/api/v1/workspaces/:workspace_id/invites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"email": "<email>",
"role_id": "<uuid>"
}'

v1 is superseded. v1 was superseded by v2 on 2026-08-26. A sunset date has not been announced yet; v1 will be deprecated as a whole before removal. Migrate with the v2 migration guide.

Invite an email address into the workspace. The address is emailed a link that joins the workspace when followed by someone signed in with that address. Inviting an address that already has an open invitation sends it a new link, with the role given; the old link stops working.

workspace_id
required
Workspace ID

ID of the workspace that owns the resource.

string format: uuid

ID of the workspace that owns the resource.

Idempotency-Key
string
<= 255 characters

Opaque key making a retry of this request return the first result. A 2xx response is replayed for 24 hours with Idempotent-Replayed: true. A 4xx releases the key. A 5xx, or a request still running, holds the key for 120 seconds, during which a retry gets 409; after that a retry executes again. The key covers the method, path, query, and byte-identical body it was first used with; reusing it for a different request is rejected with 422. Protection is best effort: if the key store is unavailable, or a record is lost early, a retry can execute again even after an earlier 409. See the Idempotency section of the API description.

Media typeapplication/json
CreateInviteBody
object
email
required
Email

Email address to invite. It is emailed a link, valid for 14 days, that makes whoever signs in with this address a member. No Layer user is created until then.

string format: email
role_id
Role ID

ID of the role to join with, custom included. Defaults to the workspace’s default role.

string format: uuid
nullable
Examplegenerated
{
"email": "hello@example.com",
"role_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Successful Response

Media typeapplication/json
InviteOutput
object
invite_id
required
Invite ID

The invitation’s unique identifier.

string format: uuid
email
required
Email

The email address invited.

string
role_id
required
Role ID

ID of the role the invitee joins with, custom included.

string format: uuid
status
required
WorkspaceInviteStatus

Pending until accepted; expired once past expires_at without being accepted; claimed once accepted; revoked once withdrawn.

string
Allowed values: pending expired claimed revoked
invited_by_id
Invited By ID

ID of the principal who sent the invitation; null once their account is gone.

string format: uuid
nullable
created_at
required
Created At

When the address was first invited.

string format: date-time
sent_at
required
Sent At

When the latest invitation email, with its link, was sent.

string format: date-time
expires_at
required
Expires At

When the latest link stops working.

string format: date-time
claimed_at
Claimed At

When the invitation was accepted.

string format: date-time
nullable
claimed_by_id
Claimed By ID

ID of the user who accepted the invitation.

string format: uuid
nullable
revoked_at
Revoked At

When the invitation was withdrawn.

string format: date-time
nullable
Example
{
"status": "pending"
}

Unauthenticated — missing or invalid Bearer token.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

Forbidden — insufficient permissions, or the access token lacks the scope the operation requires.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

Resource not found.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

The outcome of the request with this Idempotency-Key is not known yet: it is still running, or it failed without a stored response. Retry after the number of seconds in Retry-After.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

Invalid input parameters, or an Idempotency-Key reused for a different request.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

Rate limited — retry after the number of seconds in Retry-After.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}

Internal server error.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
error_code
required

Machine-readable error code: the last path segment of type.

string
field

The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.

string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description.",
"error_code": "ERROR_CODE",
"field": "tileability"
}