Skip to main content

Add User to a Tenant

Add a user to a tenant. Note that both the user being assigned and the tenant the user is being assigned to must already exist. Refer to the documentation to create a user and create a tenant for help.

caution

This endpoint has been deprecated and will be phased out at the end of 2023. Please update any existing usages of it to use the Create Warrant endpoint instead.

Endpoint

POST /v1/tenants/:tenantId/users/:userId

Parameters

ParameterDescriptionTypeRequired
tenantIdThe tenantId of the tenant you want to add a user to.URL paramyes
userIdThe userId of the user you want to add to the tenant.URL paramyes

Request

curl "https://api.warrant.dev/v1/tenants/my-tenant/users/my-user" \
-X POST \
-H "Authorization: ApiKey YOUR_KEY"

Response

{
"objectType": "tenant",
"objectId": "my-tenant",
"relation": "member",
"subject": {
"objectType": "user",
"objectId": "my-user"
}
}