Create Audience Tenant

POST
/v1/admin/projects/{project_id}/audience-tenants

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Bearer credential. API keys look like sqk_<geo>_<key_id>_<secret>: treat them as opaque and never put one in a browser. Older keys without the geo part stay valid until rotated. Find a geo's endpoints through GET /.well-known/sparq-discovery before sending a key.

Path Parameters

project_id*Project Id
Formatuuid

Header Parameters

Sparq-Workspace?string

For a person signed in to a console with several workspaces: the workspace this call is for, one of their memberships (listMyMemberships). Without it such a person gets workspace_required (400); a workspace they are not a member of is forbidden. It never grants anything, and other callers' credentials ignore it.

Formatuuid
Idempotency-Key?string

Makes a retry safe: the same key, route and body within 24 hours returns the stored response and the same result id. The same key with a different body or route is idempotency_conflict; while the first request runs, idempotency_in_progress.

Length8 <= length <= 128

Request Body

application/json
  1. body
external_id*External Id

The host's own identifier for this customer, as found in its tokens.

Length1 <= length <= 200
name*Name
Length1 <= length <= 500
region?|

One of the workspace's allowed regions. Default: its home region.

Response Body

Successful Response

application/json
  1. response

A customer of the host application, or the project's own reserved tenant.

audience_tenant_id*Audience Tenant Id
Formatuuid
project_id*Project Id
Formatuuid
kind*Kind

'project' marks the one reserved tenant each project has; it has no external_id and cannot be created or deleted through the API.

Value in"customer""project"
external_id*|

The host's identifier; empty for 'project'.

name*Name
status*Status
Value in"active""suspended"
created_at*Created At
Formatdate-time
region?|

Where the client's data lives.

Example Request
curl -X POST 'http://dev-sparq.centralindia.cloudapp.azure.com:8000/v1/admin/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/audience-tenants' \  -H 'Content-Type: application/json' \  -d '{  "external_id": "string",  "name": "string"}'
Example Response
{  "audience_tenant_id": "0287c3f7-886a-49f4-a73e-03577e798c26",  "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",  "kind": "customer",  "external_id": "string",  "name": "string",  "status": "active",  "created_at": "2019-08-24T14:15:22Z",  "region": "westeurope"}