> For the complete documentation index, see [llms.txt](https://knowledgebase.fabricdata.com/studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.fabricdata.com/studio/integrations-and-apis/origin-studio-production-api/tenants.md).

# Tenants

Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access.

## Get all tenants

> Lists all tenants, ordered by creation date. Page through results with \`page.cursor\`.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"GetTenantsResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantFindManyResponse","description":"A list of tenants.","type":"object","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","type","attributes"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["tenants"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/TenantAttributes","required":["fullName","key","plan"]}]},"relationships":{"$ref":"#/components/schemas/TenantRelationships"},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false}}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"},"next":{"type":["string","null"]}},"additionalProperties":false},"meta":{"type":"object","properties":{"cursor":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"TenantAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantAttributes","description":"A tenant's profile: display name, key, plan and contact details.","type":"object","additionalProperties":false,"required":["fullName","key","plan"],"properties":{"fullName":{"type":"string","description":"The tenant's display name, such as a studio or company name."},"contactInfo":{"type":"object","description":"Contact details for the tenant.","properties":{"email":{"type":"string"},"phone":{"type":"string"},"address":{"type":"string"}},"additionalProperties":false},"key":{"type":"string","description":"Unique key for the tenant. URLs and references use it."},"description":{"type":"string"},"policyStoreId":{"type":"string"},"auth0OrganizationId":{"type":"string","description":"The Auth0 organization linked to the tenant."},"plan":{"type":"string","description":"Subscription plan, such as `pro`, `team` or `enterprise`."},"planQuota":{"type":"object","description":"The plan's resource quotas.","properties":{"userCount":{"type":"number","description":"Maximum users in the tenant."},"recordCount":{"type":"number","description":"Maximum records in the tenant."},"deliveryRecordCount":{"type":"number","description":"Maximum delivery records in the tenant."},"apiCallCount":{"type":"number","description":"Maximum API calls per month."},"mediaStorageBytes":{"type":"number","description":"Maximum media storage, in bytes."}},"additionalProperties":false},"audit":{"type":"object","description":"Audit log settings for the tenant.","properties":{"retention":{"type":"object","description":"Retention policy for audit log files.","required":["days"],"properties":{"days":{"type":"number","description":"Days to keep audit log files. One of: 1, 30, 60, 90, 365, 730, 1095, 1460, 1825, 2555."}},"additionalProperties":false}},"additionalProperties":false,"required":["retention"]},"defaultRoleName":{"type":"string","description":"The role the server gives a user who signs in to the tenant for the first time without an assigned role. Absent when the tenant has no default role."}}},"TenantRelationships":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantRelationships","description":"Who created the tenant (`author`) and who last changed it (`updatedBy`). Each carries the user's display name and tenant in `meta`.","type":"object","properties":{"author":{"type":"object","required":["data"],"additionalProperties":false,"properties":{"data":{"type":"object","required":["id","type","meta"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["users"]},"meta":{"type":"object","required":["tenantId","type","displayName"],"properties":{"tenantId":{"type":"string"},"type":{"type":"string"},"displayName":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false}}},"updatedBy":{"type":"object","required":["data"],"additionalProperties":false,"properties":{"data":{"type":"object","required":["id","type","meta"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["users"]},"meta":{"type":"object","required":["tenantId","type","displayName"],"properties":{"tenantId":{"type":"string"},"type":{"type":"string"},"displayName":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false}}}},"additionalProperties":false},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/tenants":{"get":{"summary":"Get all tenants","description":"Lists all tenants, ordered by creation date. Page through results with `page.cursor`.","operationId":"tenantFindMany","tags":["Tenants"],"parameters":[{"name":"page.cursor","in":"query","description":"The previous page's `meta.cursor`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTenantsResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Create a tenant

> Creates a tenant. When you omit \`organizationId\`, the server creates an Auth0 organization named after the tenant \`key\`, with \`fullName\` as its display name, unless another organization already uses that name.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"CreateTenantRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantCreateRequest","description":"Creates a tenant.","type":"object","properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"},"data":{"allOf":[{"$ref":"#/components/schemas/BaseCreateRequest"},{"additionalProperties":false,"properties":{"id":{"type":"string"},"attributes":{"type":"object","required":["fullName","contactInfo","key","description","plan","planQuota"],"additionalProperties":false,"properties":{"fullName":{"type":"string"},"contactInfo":{"type":"object","required":["email"],"properties":{"email":{"type":"string"},"phone":{"type":"string"},"address":{"type":"string"}},"additionalProperties":false},"key":{"type":"string"},"description":{"type":"string"},"auth0UserId":{"type":"string","description":"An Auth0 user to add to the tenant's Auth0 organization."},"shouldCreateUsagePlan":{"type":"boolean"},"audit":{"type":"object","description":"Audit log settings for the tenant.","properties":{"retention":{"type":"object","description":"How long to keep audit log files.","required":["days"],"properties":{"days":{"type":"number","description":"Days to keep audit log files: 1, 30, 60, 90, 365, 730, 1095, 1460, 1825 or 2555. Defaults to 30."}},"additionalProperties":false}},"additionalProperties":false,"required":["retention"]},"organizationId":{"type":"string","description":"An existing Auth0 organization to link the tenant to. When you omit it, the server creates an Auth0 organization named after the tenant `key`, with `fullName` as its `display_name`, unless that organization name is already in use."},"plan":{"type":"string","enum":["pro","team","enterprise"]},"planQuota":{"type":"object","description":"Resource quotas for the tenant plan","required":["userCount","recordCount","deliveryRecordCount","apiCallCount","mediaStorageBytes"],"additionalProperties":false,"properties":{"userCount":{"type":"number","description":"Maximum number of users in the tenant."},"recordCount":{"type":"number","description":"Maximum number of records in the tenant."},"deliveryRecordCount":{"type":"number","description":"Maximum number of delivery records in the tenant."},"apiCallCount":{"type":"integer","minimum":1,"description":"Maximum number of API calls per month."},"mediaStorageBytes":{"type":"number","description":"Maximum media storage in bytes"}}}}}},"required":["id","attributes"]}]}},"required":["data"],"additionalProperties":false},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"BaseCreateRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseCreateRequest","description":"Base shape for create requests. `type` must match the target resource type. Omit `id` to let the server generate one.","type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["type"]},"TenantCreateOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantCreateOneResponse","description":"The created tenant's id and `self` link.","type":"object","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"type":"object","required":["id","type"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["tenants"]}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/tenants":{"post":{"summary":"Create a tenant","operationId":"tenantCreateOne","description":"Creates a tenant. When you omit `organizationId`, the server creates an Auth0 organization named after the tenant `key`, with `fullName` as its display name, unless another organization already uses that name.","tags":["Tenants"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenantRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantCreateOneResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get a tenant by ID

> Returns one tenant.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"GetTenantResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantFindOneResponse","description":"A tenant.","type":"object","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"type":"object","required":["id","type","attributes"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["tenants"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/TenantAttributes","required":["fullName","key","plan"]}]},"relationships":{"$ref":"#/components/schemas/TenantRelationships"}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"TenantAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantAttributes","description":"A tenant's profile: display name, key, plan and contact details.","type":"object","additionalProperties":false,"required":["fullName","key","plan"],"properties":{"fullName":{"type":"string","description":"The tenant's display name, such as a studio or company name."},"contactInfo":{"type":"object","description":"Contact details for the tenant.","properties":{"email":{"type":"string"},"phone":{"type":"string"},"address":{"type":"string"}},"additionalProperties":false},"key":{"type":"string","description":"Unique key for the tenant. URLs and references use it."},"description":{"type":"string"},"policyStoreId":{"type":"string"},"auth0OrganizationId":{"type":"string","description":"The Auth0 organization linked to the tenant."},"plan":{"type":"string","description":"Subscription plan, such as `pro`, `team` or `enterprise`."},"planQuota":{"type":"object","description":"The plan's resource quotas.","properties":{"userCount":{"type":"number","description":"Maximum users in the tenant."},"recordCount":{"type":"number","description":"Maximum records in the tenant."},"deliveryRecordCount":{"type":"number","description":"Maximum delivery records in the tenant."},"apiCallCount":{"type":"number","description":"Maximum API calls per month."},"mediaStorageBytes":{"type":"number","description":"Maximum media storage, in bytes."}},"additionalProperties":false},"audit":{"type":"object","description":"Audit log settings for the tenant.","properties":{"retention":{"type":"object","description":"Retention policy for audit log files.","required":["days"],"properties":{"days":{"type":"number","description":"Days to keep audit log files. One of: 1, 30, 60, 90, 365, 730, 1095, 1460, 1825, 2555."}},"additionalProperties":false}},"additionalProperties":false,"required":["retention"]},"defaultRoleName":{"type":"string","description":"The role the server gives a user who signs in to the tenant for the first time without an assigned role. Absent when the tenant has no default role."}}},"TenantRelationships":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantRelationships","description":"Who created the tenant (`author`) and who last changed it (`updatedBy`). Each carries the user's display name and tenant in `meta`.","type":"object","properties":{"author":{"type":"object","required":["data"],"additionalProperties":false,"properties":{"data":{"type":"object","required":["id","type","meta"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["users"]},"meta":{"type":"object","required":["tenantId","type","displayName"],"properties":{"tenantId":{"type":"string"},"type":{"type":"string"},"displayName":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false}}},"updatedBy":{"type":"object","required":["data"],"additionalProperties":false,"properties":{"data":{"type":"object","required":["id","type","meta"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["users"]},"meta":{"type":"object","required":["tenantId","type","displayName"],"properties":{"tenantId":{"type":"string"},"type":{"type":"string"},"displayName":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false}}}},"additionalProperties":false},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/tenants/{tenantId}":{"get":{"summary":"Get a tenant by ID","description":"Returns one tenant.","operationId":"tenantFindOne","tags":["Tenants"],"parameters":[{"name":"tenantId","in":"path","description":"The tenant ID, or `me` for the tenant in the caller's token.","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"string","enum":["me"]}]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTenantResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Update a tenant by ID

> Updates the fields you send and returns the updated tenant.\
> \- Only operator accounts can change \`plan\`, \`planQuota\` or \`audit\`.\
> \- A new \`planQuota.apiCallCount\` applies the monthly API call allowance immediately. If the server can't apply it, the whole update fails and the server saves nothing.\
> \- The service accepts at most one allowance change every 20 seconds, service-wide. It currently answers 500 when it refuses a change for this reason: wait about 20 seconds and retry.\
> \- If the server hasn't provisioned the tenant's plan yet, it stores the value and applies it when it does.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"UpdateTenantRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantUpdateRequest","description":"Updates a tenant.","type":"object","additionalProperties":false,"required":["data"],"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"},"data":{"type":"object","additionalProperties":false,"required":["id","type","attributes"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["tenants"]},"attributes":{"type":"object","additionalProperties":false,"properties":{"fullName":{"type":"string"},"description":{"type":"string"},"contactInfo":{"type":"object","additionalProperties":false,"properties":{"email":{"type":"string"},"phone":{"type":"string"},"address":{"type":"string"}}},"plan":{"type":"string","enum":["pro","team","enterprise"]},"planQuota":{"type":"object","additionalProperties":false,"properties":{"userCount":{"type":"number"},"recordCount":{"type":"number"},"deliveryRecordCount":{"type":"number"},"apiCallCount":{"type":"integer","minimum":1},"mediaStorageBytes":{"type":"number"}}},"audit":{"type":"object","additionalProperties":false,"required":["retention"],"properties":{"retention":{"type":"object","additionalProperties":false,"required":["days"],"properties":{"days":{"type":"number"}}}}},"defaultRoleName":{"type":["string","null"],"minLength":1,"description":"An assignable role in this tenant that the server gives a user who signs in for the first time without an assigned role. Send `null` to stop."}}}}}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"GetTenantResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantFindOneResponse","description":"A tenant.","type":"object","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"type":"object","required":["id","type","attributes"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["tenants"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/TenantAttributes","required":["fullName","key","plan"]}]},"relationships":{"$ref":"#/components/schemas/TenantRelationships"}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"TenantAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantAttributes","description":"A tenant's profile: display name, key, plan and contact details.","type":"object","additionalProperties":false,"required":["fullName","key","plan"],"properties":{"fullName":{"type":"string","description":"The tenant's display name, such as a studio or company name."},"contactInfo":{"type":"object","description":"Contact details for the tenant.","properties":{"email":{"type":"string"},"phone":{"type":"string"},"address":{"type":"string"}},"additionalProperties":false},"key":{"type":"string","description":"Unique key for the tenant. URLs and references use it."},"description":{"type":"string"},"policyStoreId":{"type":"string"},"auth0OrganizationId":{"type":"string","description":"The Auth0 organization linked to the tenant."},"plan":{"type":"string","description":"Subscription plan, such as `pro`, `team` or `enterprise`."},"planQuota":{"type":"object","description":"The plan's resource quotas.","properties":{"userCount":{"type":"number","description":"Maximum users in the tenant."},"recordCount":{"type":"number","description":"Maximum records in the tenant."},"deliveryRecordCount":{"type":"number","description":"Maximum delivery records in the tenant."},"apiCallCount":{"type":"number","description":"Maximum API calls per month."},"mediaStorageBytes":{"type":"number","description":"Maximum media storage, in bytes."}},"additionalProperties":false},"audit":{"type":"object","description":"Audit log settings for the tenant.","properties":{"retention":{"type":"object","description":"Retention policy for audit log files.","required":["days"],"properties":{"days":{"type":"number","description":"Days to keep audit log files. One of: 1, 30, 60, 90, 365, 730, 1095, 1460, 1825, 2555."}},"additionalProperties":false}},"additionalProperties":false,"required":["retention"]},"defaultRoleName":{"type":"string","description":"The role the server gives a user who signs in to the tenant for the first time without an assigned role. Absent when the tenant has no default role."}}},"TenantRelationships":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantRelationships","description":"Who created the tenant (`author`) and who last changed it (`updatedBy`). Each carries the user's display name and tenant in `meta`.","type":"object","properties":{"author":{"type":"object","required":["data"],"additionalProperties":false,"properties":{"data":{"type":"object","required":["id","type","meta"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["users"]},"meta":{"type":"object","required":["tenantId","type","displayName"],"properties":{"tenantId":{"type":"string"},"type":{"type":"string"},"displayName":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false}}},"updatedBy":{"type":"object","required":["data"],"additionalProperties":false,"properties":{"data":{"type":"object","required":["id","type","meta"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["users"]},"meta":{"type":"object","required":["tenantId","type","displayName"],"properties":{"tenantId":{"type":"string"},"type":{"type":"string"},"displayName":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false}}}},"additionalProperties":false},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/tenants/{tenantId}":{"patch":{"summary":"Update a tenant by ID","description":"Updates the fields you send and returns the updated tenant.\n- Only operator accounts can change `plan`, `planQuota` or `audit`.\n- A new `planQuota.apiCallCount` applies the monthly API call allowance immediately. If the server can't apply it, the whole update fails and the server saves nothing.\n- The service accepts at most one allowance change every 20 seconds, service-wide. It currently answers 500 when it refuses a change for this reason: wait about 20 seconds and retry.\n- If the server hasn't provisioned the tenant's plan yet, it stores the value and applies it when it does.","operationId":"tenantUpdateOne","tags":["Tenants"],"parameters":[{"name":"tenantId","description":"The tenant to update.","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTenantRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTenantResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get the feature entitlements for a tenant

> Returns every entitlement-governed feature for the tenant: whether the plan grants it, whether the tenant activated it, and the effective result. Includes features the plan doesn't grant, flagged as not granted. Features that entitlements don't govern never appear here and are always available.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"TenantFeatureFindManyResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantFeatureFindManyResponse","description":"Every registered feature, including those the tenant's plan doesn't grant. An empty array means no feature uses entitlements yet.","type":"object","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TenantFeatureResource"}},"links":{"type":"object","additionalProperties":false,"required":["self"],"properties":{"self":{"type":"string"}}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"TenantFeatureResource":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantFeatureResource","description":"One entitlement-governed feature.","type":"object","additionalProperties":false,"required":["id","type","attributes"],"properties":{"id":{"type":"string","description":"The feature's registry key."},"type":{"type":"string","enum":["features"]},"attributes":{"$ref":"#/components/schemas/TenantFeatureAttributes"},"relationships":{"type":"object","additionalProperties":false,"properties":{"author":{"type":"object","additionalProperties":false,"required":["data"],"description":"Who activated the feature. Absent until activation.","properties":{"data":{"type":"object","additionalProperties":false,"required":["id","type","meta"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["users"]},"meta":{"type":"object","additionalProperties":false,"required":["tenantId","type","displayName"],"properties":{"tenantId":{"type":"string"},"type":{"type":"string"},"displayName":{"type":"string"}}}}},"links":{"type":"object","additionalProperties":false,"properties":{"related":{"type":"string"}}}}}}},"links":{"type":"object","additionalProperties":false,"properties":{"self":{"type":"string"}}}}},"TenantFeatureAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantFeatureAttributes","description":"The state of one entitlement-governed feature for a tenant. The tenant's plan sets `granted` and the tenant's own admins set `enabled`. The response includes features the plan doesn't grant, with `granted` set to `false`.","type":"object","additionalProperties":false,"required":["granted","enabled","effective"],"properties":{"granted":{"type":"boolean","description":"The tenant's plan offers this feature."},"enabled":{"type":"boolean","description":"The tenant has activated this feature. Activation is permanent."},"effective":{"type":"boolean","description":"Both `granted` and `enabled`. Gate behaviour on this value only."},"availableOn":{"type":"array","items":{"type":"string","enum":["pro","team","enterprise"]},"description":"Plans that offer this feature. Omitted when every plan offers it. An empty array means no plan offers it any more."},"created":{"type":"string","format":"date-time","description":"When the tenant activated the feature. Absent until activation."},"updated":{"type":"string","format":"date-time","description":"When the activation last changed. Absent until activation."}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/features":{"get":{"summary":"Get the feature entitlements for a tenant","description":"Returns every entitlement-governed feature for the tenant: whether the plan grants it, whether the tenant activated it, and the effective result. Includes features the plan doesn't grant, flagged as not granted. Features that entitlements don't govern never appear here and are always available.","operationId":"tenantFeatureFindMany","tags":["Tenants"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantFeatureFindManyResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Activate a feature for a tenant

> Activates a released feature for the tenant. Activation is permanent for every feature. Activating an already active feature succeeds without a second write.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"UpdateTenantFeatureRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IUpdateTenantFeatureRequest","description":"Activates a feature for the tenant.","type":"object","additionalProperties":false,"required":["data"],"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"},"data":{"type":"object","additionalProperties":false,"required":["type","attributes"],"properties":{"type":{"type":"string","enum":["features"]},"attributes":{"type":"object","additionalProperties":false,"required":["enabled"],"properties":{"enabled":{"type":"boolean","const":true,"description":"Must be `true`. You can't undo activation."}}}}}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"TenantFeatureFindOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantFeatureFindOneResponse","description":"The feature after activation.","type":"object","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"$ref":"#/components/schemas/TenantFeatureResource"},"links":{"type":"object","additionalProperties":false,"required":["self"],"properties":{"self":{"type":"string"}}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"TenantFeatureResource":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantFeatureResource","description":"One entitlement-governed feature.","type":"object","additionalProperties":false,"required":["id","type","attributes"],"properties":{"id":{"type":"string","description":"The feature's registry key."},"type":{"type":"string","enum":["features"]},"attributes":{"$ref":"#/components/schemas/TenantFeatureAttributes"},"relationships":{"type":"object","additionalProperties":false,"properties":{"author":{"type":"object","additionalProperties":false,"required":["data"],"description":"Who activated the feature. Absent until activation.","properties":{"data":{"type":"object","additionalProperties":false,"required":["id","type","meta"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["users"]},"meta":{"type":"object","additionalProperties":false,"required":["tenantId","type","displayName"],"properties":{"tenantId":{"type":"string"},"type":{"type":"string"},"displayName":{"type":"string"}}}}},"links":{"type":"object","additionalProperties":false,"properties":{"related":{"type":"string"}}}}}}},"links":{"type":"object","additionalProperties":false,"properties":{"self":{"type":"string"}}}}},"TenantFeatureAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantFeatureAttributes","description":"The state of one entitlement-governed feature for a tenant. The tenant's plan sets `granted` and the tenant's own admins set `enabled`. The response includes features the plan doesn't grant, with `granted` set to `false`.","type":"object","additionalProperties":false,"required":["granted","enabled","effective"],"properties":{"granted":{"type":"boolean","description":"The tenant's plan offers this feature."},"enabled":{"type":"boolean","description":"The tenant has activated this feature. Activation is permanent."},"effective":{"type":"boolean","description":"Both `granted` and `enabled`. Gate behaviour on this value only."},"availableOn":{"type":"array","items":{"type":"string","enum":["pro","team","enterprise"]},"description":"Plans that offer this feature. Omitted when every plan offers it. An empty array means no plan offers it any more."},"created":{"type":"string","format":"date-time","description":"When the tenant activated the feature. Absent until activation."},"updated":{"type":"string","format":"date-time","description":"When the activation last changed. Absent until activation."}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/features/{featureKey}":{"patch":{"summary":"Activate a feature for a tenant","description":"Activates a released feature for the tenant. Activation is permanent for every feature. Activating an already active feature succeeds without a second write.","operationId":"tenantFeatureUpdateOne","tags":["Tenants"],"parameters":[{"name":"featureKey","description":"The key of the feature to activate.","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTenantFeatureRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantFeatureFindOneResponse"}}}},"400":{"description":"Bad Request: `enabled` must be `true`; you can't deactivate a feature.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden: the tenant's plan doesn't grant this feature.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found: unknown feature key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /policyTemplates

> List policy templates

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"PolicyTemplateFindManyResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyTemplateFindManyResponse","description":"A list of policy templates.","additionalProperties":false,"required":["data","links","jsonapi"],"type":"object","properties":{"data":{"type":"array","items":{"title":"IPolicyTemplate","type":"object","required":["id","type","attributes","relationships"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["policyTemplates"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/PolicyTemplateAttributes"}]},"relationships":{"$ref":"#/components/schemas/PolicyTemplateRelationships"},"meta":{"type":"object","properties":{"tenantId":{"type":"string","description":"The tenant ID"}},"required":["tenantId"],"additionalProperties":false}}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"PolicyTemplateAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyTemplateAttributes","description":"A policy template's attributes.","additionalProperties":false,"required":["resourceType","name","label","actions"],"type":"object","properties":{"resourceType":{"type":"string","enum":["record","contributor","delivery","bulkActions","workingSet"],"description":"The resource type this template targets"},"name":{"type":"string","description":"The template's name. You can't change it after creation."},"label":{"type":"string","description":"The display label for the policy template"},"description":{"type":"string","description":"The description of the policy template"},"actions":{"type":"array","description":"The actions the template allows.","items":{"type":"string"}},"locales":{"type":"array","items":{"type":"string"}},"workTypeEntityAccess":{"type":"object","additionalProperties":{"type":"object","properties":{"creditsAccess":{"type":"boolean"},"mediaAccess":{"type":"array","items":{"type":"string"}},"externalDataAccess":{"type":"boolean"},"alternateRunningOrdersAccess":{"type":"boolean"}},"additionalProperties":false}},"workTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkTypes"}},"lifecyclePhases":{"type":"array","items":{"type":"string","enum":["drafting","published"]}},"workTypeLifecycleAccess":{"type":"object","description":"Lifecycle status access, keyed by work type. Requires the `statusBasedPermissions` entitlement. When set, the policy is status-based and the server derives `lifecyclePhases` from these statuses.","additionalProperties":{"type":"array","items":{"type":"string"}}},"sectionIds":{"type":"array","items":{"type":"string"}},"createSources":{"type":"array","items":{"type":"string","enum":["custom","origin"]}},"updateTypes":{"type":"array","items":{"type":"string","enum":["regular","publish"]}},"recordHistoryAccess":{"type":"boolean","description":"`record` templates only. When true, holders of the policy can also view the change history of the records it covers, within the same work types, lifecycle and security tags as the rest of the policy. Absent means false. Read access alone never grants history access; only this flag does."},"recordMoveAccess":{"type":"boolean","description":"`record` templates only. When true, holders of the policy can also move the records it covers, with everything below them, under another parent, within the same work types, lifecycle and security tags as the rest of the policy. Absent means false. Update access alone never grants move access; in a custom policy, only this flag does."}}},"WorkTypes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"WorkTypes","description":"The key of one of the tenant's work types. Every tenant has seven built-in work types:\n- `Movie`: a standalone feature-length film\n- `MovieEdit`: a variation of a Movie\n- `Series`: a TV or streaming series\n- `Season`: a season within a Series\n- `Episode`: a single episode\n- `EpisodeEdit`: a variation of an Episode\n- `Compilation`: an editorially curated collection of existing records\n\nTenants can also define custom work types; list them with `GET /workTypes`.","type":"string","pattern":"^[A-Z][A-Za-z0-9]{1,39}$"},"PolicyTemplateRelationships":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"IPolicyTemplateRelationships","properties":{"tenant":{"$ref":"#/components/schemas/TenantRelationship"}},"required":["tenant"],"additionalProperties":false},"TenantRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantRelationship","description":"A relationship to a tenant","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["tenants"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data","links"],"additionalProperties":false},"LinksRelated":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ILinks","description":"A JSON:API links object with an absolute or relative 'related' link","type":"object","required":["related"],"properties":{"related":{"type":"string"}},"additionalProperties":false},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/policyTemplates":{"get":{"summary":"List policy templates","operationId":"policyTemplateFindMany","tags":["Tenants"],"parameters":[{"name":"filter.label","description":"Filter by display label","in":"query","required":false,"schema":{"type":"string"}},{"name":"filter.resourceType","description":"Filter by resource type","in":"query","required":false,"schema":{"type":"string","enum":["record","contributor","delivery","bulkActions","workingSet"]}},{"name":"filter.lifecycleStatusId","description":"Only templates whose `workTypeLifecycleAccess` references this lifecycle status ID, for any work type. Use it to find the templates that block deleting that status.","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyTemplateFindManyResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /policyTemplates

> Create a policy template

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"CreatePolicyTemplateRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyTemplateCreateRequest","description":"Creates a policy template.","type":"object","additionalProperties":false,"required":["data"],"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"},"data":{"type":"object","additionalProperties":false,"required":["type","attributes"],"properties":{"type":{"type":"string","enum":["policyTemplates"]},"attributes":{"$ref":"#/components/schemas/PolicyTemplateAttributes"}}}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"PolicyTemplateAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyTemplateAttributes","description":"A policy template's attributes.","additionalProperties":false,"required":["resourceType","name","label","actions"],"type":"object","properties":{"resourceType":{"type":"string","enum":["record","contributor","delivery","bulkActions","workingSet"],"description":"The resource type this template targets"},"name":{"type":"string","description":"The template's name. You can't change it after creation."},"label":{"type":"string","description":"The display label for the policy template"},"description":{"type":"string","description":"The description of the policy template"},"actions":{"type":"array","description":"The actions the template allows.","items":{"type":"string"}},"locales":{"type":"array","items":{"type":"string"}},"workTypeEntityAccess":{"type":"object","additionalProperties":{"type":"object","properties":{"creditsAccess":{"type":"boolean"},"mediaAccess":{"type":"array","items":{"type":"string"}},"externalDataAccess":{"type":"boolean"},"alternateRunningOrdersAccess":{"type":"boolean"}},"additionalProperties":false}},"workTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkTypes"}},"lifecyclePhases":{"type":"array","items":{"type":"string","enum":["drafting","published"]}},"workTypeLifecycleAccess":{"type":"object","description":"Lifecycle status access, keyed by work type. Requires the `statusBasedPermissions` entitlement. When set, the policy is status-based and the server derives `lifecyclePhases` from these statuses.","additionalProperties":{"type":"array","items":{"type":"string"}}},"sectionIds":{"type":"array","items":{"type":"string"}},"createSources":{"type":"array","items":{"type":"string","enum":["custom","origin"]}},"updateTypes":{"type":"array","items":{"type":"string","enum":["regular","publish"]}},"recordHistoryAccess":{"type":"boolean","description":"`record` templates only. When true, holders of the policy can also view the change history of the records it covers, within the same work types, lifecycle and security tags as the rest of the policy. Absent means false. Read access alone never grants history access; only this flag does."},"recordMoveAccess":{"type":"boolean","description":"`record` templates only. When true, holders of the policy can also move the records it covers, with everything below them, under another parent, within the same work types, lifecycle and security tags as the rest of the policy. Absent means false. Update access alone never grants move access; in a custom policy, only this flag does."}}},"WorkTypes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"WorkTypes","description":"The key of one of the tenant's work types. Every tenant has seven built-in work types:\n- `Movie`: a standalone feature-length film\n- `MovieEdit`: a variation of a Movie\n- `Series`: a TV or streaming series\n- `Season`: a season within a Series\n- `Episode`: a single episode\n- `EpisodeEdit`: a variation of an Episode\n- `Compilation`: an editorially curated collection of existing records\n\nTenants can also define custom work types; list them with `GET /workTypes`.","type":"string","pattern":"^[A-Z][A-Za-z0-9]{1,39}$"},"PolicyTemplateCreateOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"IPolicyTemplateCreateOneResponse","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"type":"object","required":["id","type","attributes"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["policyTemplates"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/PolicyTemplateAttributes"}]},"relationships":{"$ref":"#/components/schemas/PolicyTemplateRelationships"},"meta":{"type":"object","properties":{"tenantId":{"type":"string","description":"The tenant ID"}},"required":["tenantId"],"additionalProperties":false}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"PolicyTemplateRelationships":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"IPolicyTemplateRelationships","properties":{"tenant":{"$ref":"#/components/schemas/TenantRelationship"}},"required":["tenant"],"additionalProperties":false},"TenantRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantRelationship","description":"A relationship to a tenant","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["tenants"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data","links"],"additionalProperties":false},"LinksRelated":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ILinks","description":"A JSON:API links object with an absolute or relative 'related' link","type":"object","required":["related"],"properties":{"related":{"type":"string"}},"additionalProperties":false},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/policyTemplates":{"post":{"summary":"Create a policy template","operationId":"policyTemplateCreateOne","tags":["Tenants"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePolicyTemplateRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyTemplateCreateOneResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /policyTemplates/{templateId}

> Get a policy template by ID

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"PolicyTemplateFindOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyTemplateFindOneResponse","description":"A policy template.","type":"object","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"type":"object","required":["id","type","attributes","relationships"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["policyTemplates"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/PolicyTemplateAttributes"}]},"relationships":{"$ref":"#/components/schemas/PolicyTemplateRelationships"},"meta":{"type":"object","properties":{"tenantId":{"type":"string","description":"The tenant ID"},"assignmentsCount":{"type":"number","description":"Number of active assignments for this template"}},"required":["tenantId"],"additionalProperties":false}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"PolicyTemplateAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyTemplateAttributes","description":"A policy template's attributes.","additionalProperties":false,"required":["resourceType","name","label","actions"],"type":"object","properties":{"resourceType":{"type":"string","enum":["record","contributor","delivery","bulkActions","workingSet"],"description":"The resource type this template targets"},"name":{"type":"string","description":"The template's name. You can't change it after creation."},"label":{"type":"string","description":"The display label for the policy template"},"description":{"type":"string","description":"The description of the policy template"},"actions":{"type":"array","description":"The actions the template allows.","items":{"type":"string"}},"locales":{"type":"array","items":{"type":"string"}},"workTypeEntityAccess":{"type":"object","additionalProperties":{"type":"object","properties":{"creditsAccess":{"type":"boolean"},"mediaAccess":{"type":"array","items":{"type":"string"}},"externalDataAccess":{"type":"boolean"},"alternateRunningOrdersAccess":{"type":"boolean"}},"additionalProperties":false}},"workTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkTypes"}},"lifecyclePhases":{"type":"array","items":{"type":"string","enum":["drafting","published"]}},"workTypeLifecycleAccess":{"type":"object","description":"Lifecycle status access, keyed by work type. Requires the `statusBasedPermissions` entitlement. When set, the policy is status-based and the server derives `lifecyclePhases` from these statuses.","additionalProperties":{"type":"array","items":{"type":"string"}}},"sectionIds":{"type":"array","items":{"type":"string"}},"createSources":{"type":"array","items":{"type":"string","enum":["custom","origin"]}},"updateTypes":{"type":"array","items":{"type":"string","enum":["regular","publish"]}},"recordHistoryAccess":{"type":"boolean","description":"`record` templates only. When true, holders of the policy can also view the change history of the records it covers, within the same work types, lifecycle and security tags as the rest of the policy. Absent means false. Read access alone never grants history access; only this flag does."},"recordMoveAccess":{"type":"boolean","description":"`record` templates only. When true, holders of the policy can also move the records it covers, with everything below them, under another parent, within the same work types, lifecycle and security tags as the rest of the policy. Absent means false. Update access alone never grants move access; in a custom policy, only this flag does."}}},"WorkTypes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"WorkTypes","description":"The key of one of the tenant's work types. Every tenant has seven built-in work types:\n- `Movie`: a standalone feature-length film\n- `MovieEdit`: a variation of a Movie\n- `Series`: a TV or streaming series\n- `Season`: a season within a Series\n- `Episode`: a single episode\n- `EpisodeEdit`: a variation of an Episode\n- `Compilation`: an editorially curated collection of existing records\n\nTenants can also define custom work types; list them with `GET /workTypes`.","type":"string","pattern":"^[A-Z][A-Za-z0-9]{1,39}$"},"PolicyTemplateRelationships":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"IPolicyTemplateRelationships","properties":{"tenant":{"$ref":"#/components/schemas/TenantRelationship"}},"required":["tenant"],"additionalProperties":false},"TenantRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantRelationship","description":"A relationship to a tenant","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["tenants"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data","links"],"additionalProperties":false},"LinksRelated":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ILinks","description":"A JSON:API links object with an absolute or relative 'related' link","type":"object","required":["related"],"properties":{"related":{"type":"string"}},"additionalProperties":false},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/policyTemplates/{templateId}":{"get":{"summary":"Get a policy template by ID","operationId":"policyTemplateFindOne","tags":["Tenants"],"parameters":[{"name":"templateId","description":"The ID of the policy template","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyTemplateFindOneResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Delete a policy template

> Deletes the policy template and every policy assigned from it. Roles lose the access those policies granted. If the delete fails part way, retry the request to finish it.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"WriteMetaOnlyRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteMetaOnlyRequest","description":"An optional body with only audit metadata, for mutations that take no other body, such as deletes. Use it to send `meta.audit.source` and `meta.audit.reason`.","type":"object","additionalProperties":false,"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false}}},"paths":{"/policyTemplates/{templateId}":{"delete":{"summary":"Delete a policy template","operationId":"policyTemplateDeleteOne","description":"Deletes the policy template and every policy assigned from it. Roles lose the access those policies granted. If the delete fails part way, retry the request to finish it.","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteMetaOnlyRequest"}}}},"tags":["Tenants"],"parameters":[{"name":"templateId","description":"The policy template to delete.","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The delete did not finish. Retry the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PATCH /policyTemplates/{templateId}

> Update a policy template

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"PolicyTemplateUpdateOneRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyTemplateUpdateOneRequest","description":"Updates a policy template.","type":"object","additionalProperties":false,"required":["data"],"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"},"data":{"type":"object","required":["id","type","attributes"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["policyTemplates"]},"attributes":{"type":"object","additionalProperties":false,"properties":{"label":{"type":"string"},"description":{"type":"string"},"actions":{"type":"array","items":{"type":"string"}},"locales":{"type":"array","items":{"type":"string"}},"workTypeEntityAccess":{"type":"object","additionalProperties":{"type":"object","properties":{"creditsAccess":{"type":"boolean"},"mediaAccess":{"type":"array","items":{"type":"string"}},"externalDataAccess":{"type":"boolean"},"alternateRunningOrdersAccess":{"type":"boolean"}},"additionalProperties":false}},"workTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkTypes"}},"lifecyclePhases":{"type":"array","items":{"type":"string","enum":["drafting","published"]}},"workTypeLifecycleAccess":{"type":"object","description":"Lifecycle status access, keyed by work type. Requires the `statusBasedPermissions` entitlement.","additionalProperties":{"type":"array","items":{"type":"string"}}},"sectionIds":{"type":"array","items":{"type":"string"}},"createSources":{"type":"array","items":{"type":"string","enum":["custom","origin"]}},"updateTypes":{"type":"array","items":{"type":"string","enum":["regular","publish"]}},"recordHistoryAccess":{"type":"boolean","description":"Record-type templates only. Grants access to the change history of the records the policy covers, under the same conditions as the rest of the policy. Send `false` to revoke."},"recordMoveAccess":{"type":"boolean","description":"Record-type templates only. Lets users move the records the policy covers under another parent, under the same conditions as the rest of the policy. Send `false` to revoke."}}}}}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"WorkTypes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"WorkTypes","description":"The key of one of the tenant's work types. Every tenant has seven built-in work types:\n- `Movie`: a standalone feature-length film\n- `MovieEdit`: a variation of a Movie\n- `Series`: a TV or streaming series\n- `Season`: a season within a Series\n- `Episode`: a single episode\n- `EpisodeEdit`: a variation of an Episode\n- `Compilation`: an editorially curated collection of existing records\n\nTenants can also define custom work types; list them with `GET /workTypes`.","type":"string","pattern":"^[A-Z][A-Za-z0-9]{1,39}$"},"PolicyTemplateUpdateOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyTemplateUpdateOneResponse","description":"The updated policy template.","type":"object","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"type":"object","required":["id","type","attributes","relationships"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["policyTemplates"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/PolicyTemplateAttributes"}]},"relationships":{"$ref":"#/components/schemas/PolicyTemplateRelationships"},"meta":{"type":"object","properties":{"tenantId":{"type":"string","description":"The tenant ID"}},"required":["tenantId"],"additionalProperties":false}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"PolicyTemplateAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyTemplateAttributes","description":"A policy template's attributes.","additionalProperties":false,"required":["resourceType","name","label","actions"],"type":"object","properties":{"resourceType":{"type":"string","enum":["record","contributor","delivery","bulkActions","workingSet"],"description":"The resource type this template targets"},"name":{"type":"string","description":"The template's name. You can't change it after creation."},"label":{"type":"string","description":"The display label for the policy template"},"description":{"type":"string","description":"The description of the policy template"},"actions":{"type":"array","description":"The actions the template allows.","items":{"type":"string"}},"locales":{"type":"array","items":{"type":"string"}},"workTypeEntityAccess":{"type":"object","additionalProperties":{"type":"object","properties":{"creditsAccess":{"type":"boolean"},"mediaAccess":{"type":"array","items":{"type":"string"}},"externalDataAccess":{"type":"boolean"},"alternateRunningOrdersAccess":{"type":"boolean"}},"additionalProperties":false}},"workTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkTypes"}},"lifecyclePhases":{"type":"array","items":{"type":"string","enum":["drafting","published"]}},"workTypeLifecycleAccess":{"type":"object","description":"Lifecycle status access, keyed by work type. Requires the `statusBasedPermissions` entitlement. When set, the policy is status-based and the server derives `lifecyclePhases` from these statuses.","additionalProperties":{"type":"array","items":{"type":"string"}}},"sectionIds":{"type":"array","items":{"type":"string"}},"createSources":{"type":"array","items":{"type":"string","enum":["custom","origin"]}},"updateTypes":{"type":"array","items":{"type":"string","enum":["regular","publish"]}},"recordHistoryAccess":{"type":"boolean","description":"`record` templates only. When true, holders of the policy can also view the change history of the records it covers, within the same work types, lifecycle and security tags as the rest of the policy. Absent means false. Read access alone never grants history access; only this flag does."},"recordMoveAccess":{"type":"boolean","description":"`record` templates only. When true, holders of the policy can also move the records it covers, with everything below them, under another parent, within the same work types, lifecycle and security tags as the rest of the policy. Absent means false. Update access alone never grants move access; in a custom policy, only this flag does."}}},"PolicyTemplateRelationships":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"IPolicyTemplateRelationships","properties":{"tenant":{"$ref":"#/components/schemas/TenantRelationship"}},"required":["tenant"],"additionalProperties":false},"TenantRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantRelationship","description":"A relationship to a tenant","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["tenants"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data","links"],"additionalProperties":false},"LinksRelated":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ILinks","description":"A JSON:API links object with an absolute or relative 'related' link","type":"object","required":["related"],"properties":{"related":{"type":"string"}},"additionalProperties":false},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/policyTemplates/{templateId}":{"patch":{"summary":"Update a policy template","operationId":"policyTemplateUpdateOne","tags":["Tenants"],"parameters":[{"name":"templateId","description":"The policy template to update.","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyTemplateUpdateOneRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyTemplateUpdateOneResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /policyTemplates/{templateId}/policies

> Create policies from a template for every role and security tag pair

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"AssignPolicyTemplateRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IAssignPolicyTemplateRequest","description":"Creates policies from a template for the given roles and, optionally, security tags.","type":"object","required":["data"],"additionalProperties":false,"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"},"data":{"type":"object","required":["type","attributes"],"additionalProperties":false,"properties":{"type":{"type":"string","enum":["policies"]},"attributes":{"type":"object","required":["roleIds"],"additionalProperties":false,"properties":{"roleIds":{"type":"array","items":{"type":"string"},"minItems":1,"description":"The roles to assign."},"securityTagIds":{"type":"array","items":{"type":"string"},"description":"Security tags for the policies. Required for `record` templates; the server ignores them for every other template type."}}}}}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"PolicyFindManyResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyFindManyResponse","description":"A list of policies.","additionalProperties":false,"required":["data","links","included","jsonapi"],"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["id","type","attributes","relationships"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["policies"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/PolicyAttributes"}]},"relationships":{"$ref":"#/components/schemas/PolicyRelationships"},"meta":{"type":"object","properties":{"tenantId":{"type":"string","description":"The tenant ID"}},"required":["tenantId"],"additionalProperties":false}}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"},"next":{"type":"string","nullable":true}},"additionalProperties":false},"included":{"type":"array","items":{"type":"object","required":["id","type","attributes","relationships"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["policyTemplates"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/PolicyTemplateAttributes"}]},"relationships":{"$ref":"#/components/schemas/PolicyTemplateRelationships"},"meta":{"type":"object","properties":{"tenantId":{"type":"string","description":"The tenant ID"}},"required":["tenantId"],"additionalProperties":false}}}},"meta":{"type":"object","properties":{"cursor":{"type":"string","nullable":true}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"PolicyAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyAttributes","description":"A policy's attributes.","additionalProperties":false,"required":["resourceType"],"type":"object","properties":{"resourceType":{"type":"string","enum":["record","contributor","delivery","bulkActions","workingSet"],"description":"The resource type this policy applies to"}}},"PolicyRelationships":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"IPolicyRelationships","description":"The policy's tenant, role and security tag.","properties":{"tenant":{"$ref":"#/components/schemas/TenantRelationship"},"role":{"$ref":"#/components/schemas/RoleRelationship"},"template":{"$ref":"#/components/schemas/PolicyTemplateRelationship"},"securityTag":{"$ref":"#/components/schemas/SecurityTagRelationship"}},"required":["tenant","role"],"additionalProperties":false},"TenantRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantRelationship","description":"A relationship to a tenant","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["tenants"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data","links"],"additionalProperties":false},"LinksRelated":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ILinks","description":"A JSON:API links object with an absolute or relative 'related' link","type":"object","required":["related"],"properties":{"related":{"type":"string"}},"additionalProperties":false},"RoleRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IRoleRelationship","description":"A relationship to a role","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["userRoles"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data"],"additionalProperties":false},"PolicyTemplateRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyTemplateRelationship","description":"A relationship to a policy template","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["policyTemplates"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data"],"additionalProperties":false},"SecurityTagRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ISecurityTagRelationship","description":"A relationship to a security tag","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["securityTags"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data"],"additionalProperties":false},"PolicyTemplateAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyTemplateAttributes","description":"A policy template's attributes.","additionalProperties":false,"required":["resourceType","name","label","actions"],"type":"object","properties":{"resourceType":{"type":"string","enum":["record","contributor","delivery","bulkActions","workingSet"],"description":"The resource type this template targets"},"name":{"type":"string","description":"The template's name. You can't change it after creation."},"label":{"type":"string","description":"The display label for the policy template"},"description":{"type":"string","description":"The description of the policy template"},"actions":{"type":"array","description":"The actions the template allows.","items":{"type":"string"}},"locales":{"type":"array","items":{"type":"string"}},"workTypeEntityAccess":{"type":"object","additionalProperties":{"type":"object","properties":{"creditsAccess":{"type":"boolean"},"mediaAccess":{"type":"array","items":{"type":"string"}},"externalDataAccess":{"type":"boolean"},"alternateRunningOrdersAccess":{"type":"boolean"}},"additionalProperties":false}},"workTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkTypes"}},"lifecyclePhases":{"type":"array","items":{"type":"string","enum":["drafting","published"]}},"workTypeLifecycleAccess":{"type":"object","description":"Lifecycle status access, keyed by work type. Requires the `statusBasedPermissions` entitlement. When set, the policy is status-based and the server derives `lifecyclePhases` from these statuses.","additionalProperties":{"type":"array","items":{"type":"string"}}},"sectionIds":{"type":"array","items":{"type":"string"}},"createSources":{"type":"array","items":{"type":"string","enum":["custom","origin"]}},"updateTypes":{"type":"array","items":{"type":"string","enum":["regular","publish"]}},"recordHistoryAccess":{"type":"boolean","description":"`record` templates only. When true, holders of the policy can also view the change history of the records it covers, within the same work types, lifecycle and security tags as the rest of the policy. Absent means false. Read access alone never grants history access; only this flag does."},"recordMoveAccess":{"type":"boolean","description":"`record` templates only. When true, holders of the policy can also move the records it covers, with everything below them, under another parent, within the same work types, lifecycle and security tags as the rest of the policy. Absent means false. Update access alone never grants move access; in a custom policy, only this flag does."}}},"WorkTypes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"WorkTypes","description":"The key of one of the tenant's work types. Every tenant has seven built-in work types:\n- `Movie`: a standalone feature-length film\n- `MovieEdit`: a variation of a Movie\n- `Series`: a TV or streaming series\n- `Season`: a season within a Series\n- `Episode`: a single episode\n- `EpisodeEdit`: a variation of an Episode\n- `Compilation`: an editorially curated collection of existing records\n\nTenants can also define custom work types; list them with `GET /workTypes`.","type":"string","pattern":"^[A-Z][A-Za-z0-9]{1,39}$"},"PolicyTemplateRelationships":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"IPolicyTemplateRelationships","properties":{"tenant":{"$ref":"#/components/schemas/TenantRelationship"}},"required":["tenant"],"additionalProperties":false},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/policyTemplates/{templateId}/policies":{"post":{"summary":"Create policies from a template for every role and security tag pair","operationId":"policyTemplatePoliciesCreate","tags":["Tenants"],"parameters":[{"name":"templateId","description":"The ID of the policy template","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignPolicyTemplateRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyFindManyResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get all policies for a tenant

> Lists the security policies in the caller's tenant. A policy defines what actions a role can perform on resources such as records and contributors, optionally limited to records with one security tag. Filter by role, resource type, template, security tag or lifecycle status. Page through results with \`page.cursor\`, in a stable order.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"PolicyFindManyResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyFindManyResponse","description":"A list of policies.","additionalProperties":false,"required":["data","links","included","jsonapi"],"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["id","type","attributes","relationships"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["policies"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/PolicyAttributes"}]},"relationships":{"$ref":"#/components/schemas/PolicyRelationships"},"meta":{"type":"object","properties":{"tenantId":{"type":"string","description":"The tenant ID"}},"required":["tenantId"],"additionalProperties":false}}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"},"next":{"type":"string","nullable":true}},"additionalProperties":false},"included":{"type":"array","items":{"type":"object","required":["id","type","attributes","relationships"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["policyTemplates"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/PolicyTemplateAttributes"}]},"relationships":{"$ref":"#/components/schemas/PolicyTemplateRelationships"},"meta":{"type":"object","properties":{"tenantId":{"type":"string","description":"The tenant ID"}},"required":["tenantId"],"additionalProperties":false}}}},"meta":{"type":"object","properties":{"cursor":{"type":"string","nullable":true}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"PolicyAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyAttributes","description":"A policy's attributes.","additionalProperties":false,"required":["resourceType"],"type":"object","properties":{"resourceType":{"type":"string","enum":["record","contributor","delivery","bulkActions","workingSet"],"description":"The resource type this policy applies to"}}},"PolicyRelationships":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"IPolicyRelationships","description":"The policy's tenant, role and security tag.","properties":{"tenant":{"$ref":"#/components/schemas/TenantRelationship"},"role":{"$ref":"#/components/schemas/RoleRelationship"},"template":{"$ref":"#/components/schemas/PolicyTemplateRelationship"},"securityTag":{"$ref":"#/components/schemas/SecurityTagRelationship"}},"required":["tenant","role"],"additionalProperties":false},"TenantRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantRelationship","description":"A relationship to a tenant","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["tenants"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data","links"],"additionalProperties":false},"LinksRelated":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ILinks","description":"A JSON:API links object with an absolute or relative 'related' link","type":"object","required":["related"],"properties":{"related":{"type":"string"}},"additionalProperties":false},"RoleRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IRoleRelationship","description":"A relationship to a role","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["userRoles"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data"],"additionalProperties":false},"PolicyTemplateRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyTemplateRelationship","description":"A relationship to a policy template","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["policyTemplates"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data"],"additionalProperties":false},"SecurityTagRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ISecurityTagRelationship","description":"A relationship to a security tag","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["securityTags"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data"],"additionalProperties":false},"PolicyTemplateAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyTemplateAttributes","description":"A policy template's attributes.","additionalProperties":false,"required":["resourceType","name","label","actions"],"type":"object","properties":{"resourceType":{"type":"string","enum":["record","contributor","delivery","bulkActions","workingSet"],"description":"The resource type this template targets"},"name":{"type":"string","description":"The template's name. You can't change it after creation."},"label":{"type":"string","description":"The display label for the policy template"},"description":{"type":"string","description":"The description of the policy template"},"actions":{"type":"array","description":"The actions the template allows.","items":{"type":"string"}},"locales":{"type":"array","items":{"type":"string"}},"workTypeEntityAccess":{"type":"object","additionalProperties":{"type":"object","properties":{"creditsAccess":{"type":"boolean"},"mediaAccess":{"type":"array","items":{"type":"string"}},"externalDataAccess":{"type":"boolean"},"alternateRunningOrdersAccess":{"type":"boolean"}},"additionalProperties":false}},"workTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkTypes"}},"lifecyclePhases":{"type":"array","items":{"type":"string","enum":["drafting","published"]}},"workTypeLifecycleAccess":{"type":"object","description":"Lifecycle status access, keyed by work type. Requires the `statusBasedPermissions` entitlement. When set, the policy is status-based and the server derives `lifecyclePhases` from these statuses.","additionalProperties":{"type":"array","items":{"type":"string"}}},"sectionIds":{"type":"array","items":{"type":"string"}},"createSources":{"type":"array","items":{"type":"string","enum":["custom","origin"]}},"updateTypes":{"type":"array","items":{"type":"string","enum":["regular","publish"]}},"recordHistoryAccess":{"type":"boolean","description":"`record` templates only. When true, holders of the policy can also view the change history of the records it covers, within the same work types, lifecycle and security tags as the rest of the policy. Absent means false. Read access alone never grants history access; only this flag does."},"recordMoveAccess":{"type":"boolean","description":"`record` templates only. When true, holders of the policy can also move the records it covers, with everything below them, under another parent, within the same work types, lifecycle and security tags as the rest of the policy. Absent means false. Update access alone never grants move access; in a custom policy, only this flag does."}}},"WorkTypes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"WorkTypes","description":"The key of one of the tenant's work types. Every tenant has seven built-in work types:\n- `Movie`: a standalone feature-length film\n- `MovieEdit`: a variation of a Movie\n- `Series`: a TV or streaming series\n- `Season`: a season within a Series\n- `Episode`: a single episode\n- `EpisodeEdit`: a variation of an Episode\n- `Compilation`: an editorially curated collection of existing records\n\nTenants can also define custom work types; list them with `GET /workTypes`.","type":"string","pattern":"^[A-Z][A-Za-z0-9]{1,39}$"},"PolicyTemplateRelationships":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"IPolicyTemplateRelationships","properties":{"tenant":{"$ref":"#/components/schemas/TenantRelationship"}},"required":["tenant"],"additionalProperties":false},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/policies":{"get":{"summary":"Get all policies for a tenant","description":"Lists the security policies in the caller's tenant. A policy defines what actions a role can perform on resources such as records and contributors, optionally limited to records with one security tag. Filter by role, resource type, template, security tag or lifecycle status. Page through results with `page.cursor`, in a stable order.","operationId":"policyFindMany","tags":["Tenants"],"parameters":[{"name":"page.cursor","description":"The previous page's `meta.cursor`.","in":"query","required":false,"schema":{"type":"string"}},{"name":"page.size","description":"Policies per page. Default 50, maximum 200.","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"filter.role.id","description":"Filter by role ID","in":"query","required":false,"schema":{"type":"string"}},{"name":"filter.resourceType","description":"Filter by resource type","in":"query","required":false,"schema":{"type":"string","enum":["record","contributor","delivery","bulkActions","workingSet"]}},{"name":"filter.template.id","description":"Filter by template ID","in":"query","required":false,"schema":{"type":"string"}},{"name":"filter.securityTag.id","description":"Filter by security tag ID","in":"query","required":false,"schema":{"type":"string"}},{"name":"filter.lifecycleStatusId","description":"Only assignments whose policy template grants this lifecycle status, for any work type.","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyFindManyResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get a policy by ID

> Returns one security policy from the caller's tenant.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"PolicyFindOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyFindOneResponse","description":"A policy.","type":"object","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"type":"object","required":["id","type","attributes","relationships"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["policies"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/PolicyAttributes"}]},"relationships":{"$ref":"#/components/schemas/PolicyRelationships"},"meta":{"type":"object","properties":{"tenantId":{"type":"string","description":"The tenant ID"},"avpPolicy":{"type":"object","description":"The stored policy details.","properties":{"resource":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string"}},"required":["entityType","entityId"],"additionalProperties":false},"principal":{"type":"object","properties":{"entityType":{"type":"string"},"entityId":{"type":"string"}},"required":["entityType","entityId"],"additionalProperties":false},"actions":{"type":"array","items":{"type":"object","properties":{"actionType":{"type":"string"},"actionId":{"type":"string"}},"required":["actionType","actionId"],"additionalProperties":false}},"effect":{"type":"string","enum":["Permit","Forbid"]}},"additionalProperties":false}},"required":["tenantId"],"additionalProperties":false}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"PolicyAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyAttributes","description":"A policy's attributes.","additionalProperties":false,"required":["resourceType"],"type":"object","properties":{"resourceType":{"type":"string","enum":["record","contributor","delivery","bulkActions","workingSet"],"description":"The resource type this policy applies to"}}},"PolicyRelationships":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"IPolicyRelationships","description":"The policy's tenant, role and security tag.","properties":{"tenant":{"$ref":"#/components/schemas/TenantRelationship"},"role":{"$ref":"#/components/schemas/RoleRelationship"},"template":{"$ref":"#/components/schemas/PolicyTemplateRelationship"},"securityTag":{"$ref":"#/components/schemas/SecurityTagRelationship"}},"required":["tenant","role"],"additionalProperties":false},"TenantRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantRelationship","description":"A relationship to a tenant","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["tenants"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data","links"],"additionalProperties":false},"LinksRelated":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ILinks","description":"A JSON:API links object with an absolute or relative 'related' link","type":"object","required":["related"],"properties":{"related":{"type":"string"}},"additionalProperties":false},"RoleRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IRoleRelationship","description":"A relationship to a role","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["userRoles"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data"],"additionalProperties":false},"PolicyTemplateRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyTemplateRelationship","description":"A relationship to a policy template","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["policyTemplates"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data"],"additionalProperties":false},"SecurityTagRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ISecurityTagRelationship","description":"A relationship to a security tag","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["securityTags"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data"],"additionalProperties":false},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/policies/{policyId}":{"get":{"summary":"Get a policy by ID","description":"Returns one security policy from the caller's tenant.","operationId":"policyFindOne","tags":["Tenants"],"parameters":[{"name":"policyId","description":"The ID of the policy","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyFindOneResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Delete a policy by ID

> Permanently deletes a security policy. Users lose the permissions it granted immediately.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"WriteMetaOnlyRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteMetaOnlyRequest","description":"An optional body with only audit metadata, for mutations that take no other body, such as deletes. Use it to send `meta.audit.source` and `meta.audit.reason`.","type":"object","additionalProperties":false,"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false}}},"paths":{"/policies/{policyId}":{"delete":{"summary":"Delete a policy by ID","description":"Permanently deletes a security policy. Users lose the permissions it granted immediately.","operationId":"policyDeleteOne","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteMetaOnlyRequest"}}}},"tags":["Tenants"],"parameters":[{"name":"policyId","description":"The policy to delete.","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The delete did not finish. Retry the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Delete several policies

> Deletes each policy on its own. If some deletes fail, the others stay deleted and the error detail lists the IDs it didn't delete. You can safely retry with the same IDs.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"PolicyAtomicOperationsRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IPolicyAtomicOperationsRequest","description":"JSON:API Atomic Operations request. Use `remove` operations to delete one or more policies in one call.","type":"object","properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"},"atomic:operations":{"type":"array","maxItems":100,"items":{"type":"object","properties":{"op":{"const":"remove"},"ref":{"$ref":"#/components/schemas/policyRefObject"}},"required":["op","ref"],"additionalProperties":false}}},"required":["atomic:operations"],"additionalProperties":false,"definitions":{"policyRefObject":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"policies"}},"required":["id","type"],"additionalProperties":false}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"policyRefObject":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"policies"}},"required":["id","type"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false}}},"paths":{"/policies/operations":{"post":{"summary":"Delete several policies","operationId":"policyAtomicOperations","description":"Deletes each policy on its own. If some deletes fail, the others stay deleted and the error detail lists the IDs it didn't delete. You can safely retry with the same IDs.","tags":["Tenants"],"requestBody":{"description":"One `remove` operation per policy to delete.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyAtomicOperationsRequest"}}},"required":true},"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The delete did not finish. Retry the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get all security tags for a tenant

> Lists the security tags in the caller's tenant. Apply tags to records to scope access: a security policy can limit access to records that carry a given tag.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"SecurityTagFindManyResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ISecurityTagFindManyResponse","description":"The tenant's security tags.","additionalProperties":false,"required":["data","links","jsonapi"],"type":"object","properties":{"data":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/BaseResource"},{"type":"object","properties":{"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/SecurityTagAttributes"}]}},"required":["attributes"],"additionalProperties":false}]}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResource":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResource","description":"A resource identifier. Every resource object carries a unique `id` and a `type`, the resource type name such as `records` or `contributors`.","type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":false},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"SecurityTagAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ISecurityTagAttributes","description":"A security tag's name and description.","type":"object","additionalProperties":false,"required":["description","name"],"properties":{"description":{"type":"string"},"name":{"type":"string"}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/securityTags":{"get":{"summary":"Get all security tags for a tenant","description":"Lists the security tags in the caller's tenant. Apply tags to records to scope access: a security policy can limit access to records that carry a given tag.","operationId":"securityTagFindMany","tags":["Tenants"],"parameters":[{"name":"filter.name","description":"Filter by tag name.","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityTagFindManyResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Create a security tag for a tenant

> Creates a security tag in the caller's tenant. Assign it to records and reference it in security policies to restrict record access.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"CreateSecurityTagRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ISecurityTagCreateRequest","description":"Creates a security tag in the tenant.","type":"object","additionalProperties":false,"required":["data"],"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"},"data":{"type":"object","additionalProperties":false,"required":["type","attributes"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["securityTags"]},"attributes":{"type":"object","additionalProperties":false,"properties":{"description":{"type":"string"},"name":{"type":"string"}},"required":["description","name"]}}}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"SecurityTagCreateOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"ISecurityTagCreateOneResponse","description":"The created security tag and its `self` link.","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/BaseResource"},{"type":"object","properties":{"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/SecurityTagAttributes","required":["description","name"]}]}},"required":["attributes"],"additionalProperties":false}]},"links":{"type":"object","properties":{"self":{"type":"string"}},"required":["self"],"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResource":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResource","description":"A resource identifier. Every resource object carries a unique `id` and a `type`, the resource type name such as `records` or `contributors`.","type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":false},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"SecurityTagAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ISecurityTagAttributes","description":"A security tag's name and description.","type":"object","additionalProperties":false,"required":["description","name"],"properties":{"description":{"type":"string"},"name":{"type":"string"}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false}}},"paths":{"/securityTags":{"post":{"summary":"Create a security tag for a tenant","description":"Creates a security tag in the caller's tenant. Assign it to records and reference it in security policies to restrict record access.","operationId":"securityTagCreateOne","tags":["Tenants"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSecurityTagRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityTagCreateOneResponse"}}}}}}}}}
```

## Get a security tag by ID

> Returns one security tag from the caller's tenant.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"SecurityTagFindOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ISecurityTagFindOneResponse","description":"One security tag.","type":"object","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"type":"object","required":["id","type","attributes"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["securityTags"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/SecurityTagAttributes","required":["description"]}]}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"SecurityTagAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ISecurityTagAttributes","description":"A security tag's name and description.","type":"object","additionalProperties":false,"required":["description","name"],"properties":{"description":{"type":"string"},"name":{"type":"string"}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false}}},"paths":{"/securityTags/{securityTagId}":{"get":{"summary":"Get a security tag by ID","description":"Returns one security tag from the caller's tenant.","operationId":"securityTagFindOne","tags":["Tenants"],"parameters":[{"name":"securityTagId","description":"The security tag to retrieve.","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityTagFindOneResponse"}}}}}}}}}
```

## Delete a security tag by ID

> Permanently deletes a security tag. Records tagged with it and policies that reference it lose the association.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"WriteMetaOnlyRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteMetaOnlyRequest","description":"An optional body with only audit metadata, for mutations that take no other body, such as deletes. Use it to send `meta.audit.source` and `meta.audit.reason`.","type":"object","additionalProperties":false,"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false}}},"paths":{"/securityTags/{securityTagId}":{"delete":{"summary":"Delete a security tag by ID","description":"Permanently deletes a security tag. Records tagged with it and policies that reference it lose the association.","operationId":"securityTagDeleteOne","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteMetaOnlyRequest"}}}},"tags":["Tenants"],"parameters":[{"name":"securityTagId","description":"The security tag to delete.","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Update a security tag by ID

> Updates the fields you send and returns the updated tag.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"UpdateSecurityTagRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ISecurityTagUpdateRequest","description":"Updates a security tag.","type":"object","additionalProperties":false,"required":["data"],"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"},"data":{"type":"object","additionalProperties":false,"required":["id","type","attributes"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["securityTags"]},"attributes":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"description":{"type":"string"}}}}}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"SecurityTagFindOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ISecurityTagFindOneResponse","description":"One security tag.","type":"object","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"type":"object","required":["id","type","attributes"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["securityTags"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/SecurityTagAttributes","required":["description"]}]}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"SecurityTagAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ISecurityTagAttributes","description":"A security tag's name and description.","type":"object","additionalProperties":false,"required":["description","name"],"properties":{"description":{"type":"string"},"name":{"type":"string"}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/securityTags/{securityTagId}":{"patch":{"summary":"Update a security tag by ID","description":"Updates the fields you send and returns the updated tag.","operationId":"securityTagUpdateOne","tags":["Tenants"],"parameters":[{"name":"securityTagId","description":"The security tag to update.","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSecurityTagRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityTagFindOneResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get all API keys for a tenant

> Lists the API keys in the caller's tenant. An API key authenticates machine-to-machine (M2M) callers, with the permissions of its roles. The list never includes the secret: you only see it when you create the key.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"ApiKeyFindManyResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IApiKeyFindManyResponse","description":"A list of API keys.","additionalProperties":false,"required":["data","links","jsonapi"],"type":"object","properties":{"data":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/BaseResource"},{"type":"object","properties":{"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/ApiKeyAttributes"}]}},"required":["attributes"],"additionalProperties":false}]}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResource":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResource","description":"A resource identifier. Every resource object carries a unique `id` and a `type`, the resource type name such as `records` or `contributors`.","type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":false},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"ApiKeyAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IApiKeyAttributes","description":"An API key's attributes. They never include the raw key: only the create response returns it.","type":"object","additionalProperties":false,"required":["description","name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"roles":{"type":"array","items":{"type":"string"}},"valuePreview":{"description":"Masked, non-secret preview of the key, such as `ak_prd_••••••••1a2b`. Identifies the key in a list.","type":"string"},"expiresAt":{"description":"ISO 8601 time after which the server refuses the key.","type":"string"}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/apiKeys":{"get":{"summary":"Get all API keys for a tenant","description":"Lists the API keys in the caller's tenant. An API key authenticates machine-to-machine (M2M) callers, with the permissions of its roles. The list never includes the secret: you only see it when you create the key.","operationId":"apiKeyFindMany","tags":["Tenants"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyFindManyResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Create an API key for a tenant

> Creates an API key in the caller's tenant. Assign it one or more roles to set its permissions. This response holds the secret, once: you can't retrieve it later, so store it securely.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"CreateApiKeyRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IApiKeyCreateRequest","description":"Creates an API key in the tenant. Set its roles in `relationships.roles` as role resource identifiers.","type":"object","additionalProperties":false,"required":["data"],"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"},"data":{"type":"object","additionalProperties":false,"required":["type","attributes","relationships"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["apiKeys"]},"attributes":{"type":"object","additionalProperties":false,"properties":{"description":{"type":"string"},"name":{"type":"string"},"expiresInDays":{"description":"Days until the key stops working, counted from creation. Defaults to 90.","type":"integer","enum":[30,60,90,180,365]}},"required":["description","name"]},"relationships":{"type":"object","additionalProperties":false,"required":["roles"],"properties":{"roles":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"data":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["id","type"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["userRoles"]}}}}}}}}}}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"ApiKeyCreateOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"IApiKeyCreateOneResponse","description":"The created API key and its self link. Only this response includes the raw key.","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/BaseResource"},{"type":"object","properties":{"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/ApiKeyCreateAttributes","required":["description","name","value"]}]}},"required":["attributes"],"additionalProperties":false}]},"links":{"type":"object","properties":{"self":{"type":"string"}},"required":["self"],"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResource":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResource","description":"A resource identifier. Every resource object carries a unique `id` and a `type`, the resource type name such as `records` or `contributors`.","type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":false},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"ApiKeyCreateAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IApiKeyCreateAttributes","description":"The new API key's attributes, including the raw key.","type":"object","additionalProperties":false,"required":["description","name","value"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"roles":{"type":"array","items":{"type":"string"}},"value":{"description":"The raw API key, in the format `ak_<env>_<32 hex chars>`. Only this response returns it and you can't retrieve it again, so show it to the user right away.","type":"string"},"valuePreview":{"description":"Masked, non-secret preview of the key, such as `ak_prd_••••••••1a2b`.","type":"string"},"expiresAt":{"description":"ISO 8601 time after which the server refuses the key.","type":"string"}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false}}},"paths":{"/apiKeys":{"post":{"summary":"Create an API key for a tenant","description":"Creates an API key in the caller's tenant. Assign it one or more roles to set its permissions. This response holds the secret, once: you can't retrieve it later, so store it securely.","operationId":"apiKeyCreateOne","tags":["Tenants"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreateOneResponse"}}}}}}}}}
```

## Get an API key by ID

> Returns one API key's metadata from the caller's tenant, without the secret.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"ApiKeyFindOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IApiKeyFindOneResponse","description":"An API key.","type":"object","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"type":"object","required":["id","type","attributes"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["apiKeys"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/ApiKeyAttributes","required":["description"]}]}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"ApiKeyAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IApiKeyAttributes","description":"An API key's attributes. They never include the raw key: only the create response returns it.","type":"object","additionalProperties":false,"required":["description","name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"roles":{"type":"array","items":{"type":"string"}},"valuePreview":{"description":"Masked, non-secret preview of the key, such as `ak_prd_••••••••1a2b`. Identifies the key in a list.","type":"string"},"expiresAt":{"description":"ISO 8601 time after which the server refuses the key.","type":"string"}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false}}},"paths":{"/apiKeys/{apiKeyId}":{"get":{"summary":"Get an API key by ID","description":"Returns one API key's metadata from the caller's tenant, without the secret.","operationId":"apiKeyFindOne","tags":["Tenants"],"parameters":[{"name":"apiKeyId","description":"The API key to retrieve.","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyFindOneResponse"}}}}}}}}}
```

## Delete an API key by ID

> Permanently revokes and deletes an API key. Clients using it lose API access immediately.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"WriteMetaOnlyRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteMetaOnlyRequest","description":"An optional body with only audit metadata, for mutations that take no other body, such as deletes. Use it to send `meta.audit.source` and `meta.audit.reason`.","type":"object","additionalProperties":false,"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false}}},"paths":{"/apiKeys/{apiKeyId}":{"delete":{"summary":"Delete an API key by ID","description":"Permanently revokes and deletes an API key. Clients using it lose API access immediately.","operationId":"apiKeyDeleteOne","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteMetaOnlyRequest"}}}},"tags":["Tenants"],"parameters":[{"name":"apiKeyId","description":"The API key to delete.","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get all AI assistant configs for a tenant

> Lists the AI assistant configurations in the caller's tenant: the selected model provider and model, and whether an API key is set.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"AiAssistantConfigFindManyResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IAiAssistantConfigFindManyResponse","description":"A list of AI assistant configurations.","additionalProperties":false,"required":["data","links","jsonapi"],"type":"object","properties":{"data":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/BaseResource"},{"type":"object","properties":{"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/AiAssistantConfigAttributes"}]}},"required":["attributes"],"additionalProperties":false}]}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResource":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResource","description":"A resource identifier. Every resource object carries a unique `id` and a `type`, the resource type name such as `records` or `contributors`.","type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":false},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"AiAssistantConfigAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IAiAssistantConfigAttributes","description":"The tenant's AI assistant settings. Read-only.","type":"object","additionalProperties":false,"required":["modelProvider","modelId","apiKeyConfigured","created","updated"],"properties":{"modelProvider":{"type":"string","enum":["bedrock","custom"],"description":"Where the model comes from.\n- `custom`: a model and API key you provide.\n- `bedrock`: a Fabric-provided model. Read-only: you can't create new configurations with it."},"modelId":{"type":"string","minLength":1,"description":"The model id.\n- `custom`: the LiteLLM model id, normally provider-qualified, such as `anthropic/claude-sonnet-4`.\n- `bedrock`: the Fabric-managed model id."},"apiKeyConfigured":{"type":"boolean","description":"Whether the configuration has a stored API key."},"apiKeyArn":{"type":"string","description":"Reference to the stored API key. The server never returns the raw key. Absent when `apiKeyConfigured` is false."},"created":{"type":"string","format":"date-time","description":"When this configuration was created"},"updated":{"type":"string","format":"date-time","description":"When this configuration was last updated"}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/aiAssistantConfigs":{"get":{"summary":"Get all AI assistant configs for a tenant","description":"Lists the AI assistant configurations in the caller's tenant: the selected model provider and model, and whether an API key is set.","operationId":"aiAssistantConfigFindMany","tags":["Tenants"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiAssistantConfigFindManyResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Create the AI assistant config for a tenant

> Creates the AI assistant configuration for the caller's tenant. Only \`custom\` is supported: bring your own model and API key.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"CreateAiAssistantConfigRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IAiAssistantConfigCreateRequest","description":"Creates the tenant's AI assistant configuration. A tenant can have only one.","type":"object","additionalProperties":false,"required":["data"],"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"},"data":{"type":"object","additionalProperties":false,"required":["type","attributes"],"properties":{"type":{"type":"string","enum":["aiAssistantConfigs"]},"attributes":{"$ref":"#/components/schemas/CreateAiAssistantConfigAttributes"}}}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"CreateAiAssistantConfigAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ICreateAiAssistantConfigAttributes","description":"The AI assistant configuration to create.","type":"object","additionalProperties":false,"required":["modelProvider","apiKey"],"properties":{"modelProvider":{"type":"string","enum":["custom"],"description":"Where the model comes from. Only `custom` is supported: you supply the model and API key."},"modelId":{"type":"string","minLength":1,"description":"The LiteLLM model id, normally provider-qualified, such as `anthropic/claude-sonnet-4`. Required."},"apiKey":{"type":"string","description":"Your provider API key. Write-only: the server stores it securely and never returns it."}}},"AiAssistantConfigCreateOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"IAiAssistantConfigCreateOneResponse","description":"The created AI assistant configuration and its self link.","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/BaseResource"},{"type":"object","properties":{"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/AiAssistantConfigAttributes"}]}},"required":["attributes"],"additionalProperties":false}]},"links":{"type":"object","properties":{"self":{"type":"string"}},"required":["self"],"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResource":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResource","description":"A resource identifier. Every resource object carries a unique `id` and a `type`, the resource type name such as `records` or `contributors`.","type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":false},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"AiAssistantConfigAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IAiAssistantConfigAttributes","description":"The tenant's AI assistant settings. Read-only.","type":"object","additionalProperties":false,"required":["modelProvider","modelId","apiKeyConfigured","created","updated"],"properties":{"modelProvider":{"type":"string","enum":["bedrock","custom"],"description":"Where the model comes from.\n- `custom`: a model and API key you provide.\n- `bedrock`: a Fabric-provided model. Read-only: you can't create new configurations with it."},"modelId":{"type":"string","minLength":1,"description":"The model id.\n- `custom`: the LiteLLM model id, normally provider-qualified, such as `anthropic/claude-sonnet-4`.\n- `bedrock`: the Fabric-managed model id."},"apiKeyConfigured":{"type":"boolean","description":"Whether the configuration has a stored API key."},"apiKeyArn":{"type":"string","description":"Reference to the stored API key. The server never returns the raw key. Absent when `apiKeyConfigured` is false."},"created":{"type":"string","format":"date-time","description":"When this configuration was created"},"updated":{"type":"string","format":"date-time","description":"When this configuration was last updated"}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/aiAssistantConfigs":{"post":{"summary":"Create the AI assistant config for a tenant","description":"Creates the AI assistant configuration for the caller's tenant. Only `custom` is supported: bring your own model and API key.","operationId":"aiAssistantConfigCreateOne","tags":["Tenants"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAiAssistantConfigRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiAssistantConfigCreateOneResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict: the tenant already has a configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get an AI assistant configuration by ID

> Returns one AI assistant configuration from the caller's tenant.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"AiAssistantConfigFindOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IAiAssistantConfigFindOneResponse","description":"An AI assistant configuration.","type":"object","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"type":"object","required":["id","type","attributes"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["aiAssistantConfigs"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/AiAssistantConfigAttributes"}]}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"AiAssistantConfigAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IAiAssistantConfigAttributes","description":"The tenant's AI assistant settings. Read-only.","type":"object","additionalProperties":false,"required":["modelProvider","modelId","apiKeyConfigured","created","updated"],"properties":{"modelProvider":{"type":"string","enum":["bedrock","custom"],"description":"Where the model comes from.\n- `custom`: a model and API key you provide.\n- `bedrock`: a Fabric-provided model. Read-only: you can't create new configurations with it."},"modelId":{"type":"string","minLength":1,"description":"The model id.\n- `custom`: the LiteLLM model id, normally provider-qualified, such as `anthropic/claude-sonnet-4`.\n- `bedrock`: the Fabric-managed model id."},"apiKeyConfigured":{"type":"boolean","description":"Whether the configuration has a stored API key."},"apiKeyArn":{"type":"string","description":"Reference to the stored API key. The server never returns the raw key. Absent when `apiKeyConfigured` is false."},"created":{"type":"string","format":"date-time","description":"When this configuration was created"},"updated":{"type":"string","format":"date-time","description":"When this configuration was last updated"}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/aiAssistantConfigs/{aiAssistantConfigId}":{"get":{"summary":"Get an AI assistant configuration by ID","description":"Returns one AI assistant configuration from the caller's tenant.","operationId":"aiAssistantConfigFindOne","tags":["Tenants"],"parameters":[{"name":"aiAssistantConfigId","description":"The AI assistant configuration to retrieve.","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiAssistantConfigFindOneResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Delete an AI assistant configuration

> Permanently deletes the AI assistant configuration for the caller's tenant, along with any stored API key.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false}}},"paths":{"/aiAssistantConfigs/{aiAssistantConfigId}":{"delete":{"summary":"Delete an AI assistant configuration","description":"Permanently deletes the AI assistant configuration for the caller's tenant, along with any stored API key.","operationId":"aiAssistantConfigDeleteOne","tags":["Tenants"],"parameters":[{"name":"aiAssistantConfigId","description":"The AI assistant configuration to delete.","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Update an AI assistant configuration

> Updates the fields you send: model provider, model, API key or endpoint URL. A new API key replaces the stored one.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"UpdateAiAssistantConfigRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IAiAssistantConfigUpdateRequest","description":"Updates the AI assistant configuration. Changes only the attributes you send.","type":"object","additionalProperties":false,"required":["data"],"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"},"data":{"type":"object","additionalProperties":false,"required":["id","type","attributes"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["aiAssistantConfigs"]},"attributes":{"type":"object","additionalProperties":false,"properties":{"modelProvider":{"type":"string","enum":["custom"],"description":"The model provider. Accepts only `custom`: send it to move a Fabric-provided configuration to your own model and API key."},"modelId":{"type":"string","minLength":1,"description":"The LiteLLM model id, usually provider-qualified, such as `anthropic/claude-sonnet-4`."},"apiKey":{"type":"string","description":"Write-only. Your provider API key. The server stores it securely and never returns it. Send a new key to rotate it."}}}}}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"AiAssistantConfigFindOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IAiAssistantConfigFindOneResponse","description":"An AI assistant configuration.","type":"object","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"type":"object","required":["id","type","attributes"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["aiAssistantConfigs"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/AiAssistantConfigAttributes"}]}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"AiAssistantConfigAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IAiAssistantConfigAttributes","description":"The tenant's AI assistant settings. Read-only.","type":"object","additionalProperties":false,"required":["modelProvider","modelId","apiKeyConfigured","created","updated"],"properties":{"modelProvider":{"type":"string","enum":["bedrock","custom"],"description":"Where the model comes from.\n- `custom`: a model and API key you provide.\n- `bedrock`: a Fabric-provided model. Read-only: you can't create new configurations with it."},"modelId":{"type":"string","minLength":1,"description":"The model id.\n- `custom`: the LiteLLM model id, normally provider-qualified, such as `anthropic/claude-sonnet-4`.\n- `bedrock`: the Fabric-managed model id."},"apiKeyConfigured":{"type":"boolean","description":"Whether the configuration has a stored API key."},"apiKeyArn":{"type":"string","description":"Reference to the stored API key. The server never returns the raw key. Absent when `apiKeyConfigured` is false."},"created":{"type":"string","format":"date-time","description":"When this configuration was created"},"updated":{"type":"string","format":"date-time","description":"When this configuration was last updated"}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/aiAssistantConfigs/{aiAssistantConfigId}":{"patch":{"summary":"Update an AI assistant configuration","description":"Updates the fields you send: model provider, model, API key or endpoint URL. A new API key replaces the stored one.","operationId":"aiAssistantConfigUpdateOne","tags":["Tenants"],"parameters":[{"name":"aiAssistantConfigId","description":"The AI assistant configuration to update.","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAiAssistantConfigRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiAssistantConfigFindOneResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get all event subscriptions for a tenant

> Lists the event subscriptions in the caller's tenant. A subscription delivers real-time notifications to an endpoint when platform events occur, such as a record created or a job completed.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"EventSubscriptionFindManyResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IEventSubscriptionFindManyResponse","description":"A list of event subscriptions.","additionalProperties":false,"required":["data","links","jsonapi"],"type":"object","properties":{"data":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/BaseResource"},{"type":"object","properties":{"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/EventSubscriptionAttributes"}]},"relationships":{"type":"object","properties":{"author":{"$ref":"#/components/schemas/UserRelationship"}},"additionalProperties":false},"links":{"$ref":"#/components/schemas/LinksSelf"}},"required":["attributes"],"additionalProperties":false}]}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"meta":{"type":"object","properties":{"awsRegion":{"type":"string"},"awsAccountId":{"type":"string"},"tenantId":{"type":"string"},"awsSubscriptions":{"type":"array","items":{"type":"object","properties":{"subscriptionArn":{"type":"string"},"pendingConfirmation":{"type":"boolean"}},"required":["subscriptionArn","pendingConfirmation"],"additionalProperties":false}}},"required":["awsRegion","awsAccountId","tenantId"," awsSubscriptions"],"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResource":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResource","description":"A resource identifier. Every resource object carries a unique `id` and a `type`, the resource type name such as `records` or `contributors`.","type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":false},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"EventSubscriptionAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IEventSubscriptionAttributes","description":"An event subscription's attributes.","type":"object","additionalProperties":false,"required":["name","type","endpoint","subscriptionArn"],"properties":{"name":{"type":"string"},"type":{"type":"string"},"endpoint":{"type":"string"},"subscriptionArn":{"type":"string"},"format":{"$ref":"#/components/schemas/EventSubscriptionFormat"},"resourceType":{"$ref":"#/components/schemas/EventSubscriptionResourceType"},"filter":{"$ref":"#/components/schemas/RecordEventSubscriptionFilter"}}},"EventSubscriptionFormat":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IEventSubscriptionFormat","description":"Message format.\n- `cloudevents`: CloudEvents 1.0 events (see `RecordCloudEvent`). `filter` selects which events you receive.","type":"string","enum":["cloudevents"]},"EventSubscriptionResourceType":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IEventSubscriptionResourceType","description":"The resource type the subscription receives events for. Each subscription covers exactly one.","type":"string","enum":["records"]},"RecordEventSubscriptionFilter":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IRecordEventSubscriptionFilter","description":"Selects the record events a records subscription receives. The subscription gets every event type in `eventTypes` for every record; `updated` can narrow `record.updated`. Allows at most 150 combinations: one per event type other than `record.updated`, plus, for `record.updated`, the product of the value counts of each `updated` property.","type":"object","additionalProperties":false,"required":["eventTypes"],"properties":{"eventTypes":{"description":"Event types to receive, as an explicit list. You never receive event types added later until you add them.\n- `record.created`: a new record.\n- `record.updated`: any other write to a record, such as a field value, its title, lifecycle status, parent or position. Each save sends one event that lists every key it saved.\n- `record.deleted`: a record moved to the deleted records.\n- `record.restored`: a record came back from the deleted records.\n- `record.purged`: a record's permanent deletion.","type":"array","uniqueItems":true,"items":{"type":"string","enum":["record.created","record.updated","record.deleted","record.restored","record.purged"]}},"updated":{"description":"Narrows `record.updated` events. Use it only when `eventTypes` includes `record.updated`. An event must match every property you set, and any one value within a property. An omitted property matches any value. Set `lifecycleStatuses` or `lifecyclePhases`, not both.","type":"object","additionalProperties":false,"properties":{"lifecycleStatuses":{"description":"Only updates to records whose lifecycle status, after the change, is one of these ids.","type":"array","uniqueItems":true,"items":{"type":"string"}},"lifecyclePhases":{"description":"Only updates to records whose lifecycle phase, after the change, is one of these ids.","type":"array","uniqueItems":true,"items":{"type":"string"}},"savedKeys":{"description":"Only updates that saved at least one of these attribute or field keys.","type":"array","uniqueItems":true,"items":{"type":"string"}}}}}},"UserRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IUserRelationship","description":"A relationship to the actor behind a write, such as `author` or `updatedBy`. `data.meta.type` is the actor type: a human user, an API key or an internal service. Only human users carry `links.related`.","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["users"]},"meta":{"type":"object","properties":{"tenantId":{"type":"string"},"type":{"type":"string"},"displayName":{"type":"string"}},"required":["tenantId","type","displayName"],"additionalProperties":false}},"required":["id","type","meta"],"additionalProperties":false},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data"],"additionalProperties":false},"LinksRelated":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ILinks","description":"A JSON:API links object with an absolute or relative 'related' link","type":"object","required":["related"],"properties":{"related":{"type":"string"}},"additionalProperties":false},"LinksSelf":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ILinksSelf","description":"A JSON:API links object with an absolute or relative 'self' link","type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/eventSubscriptions":{"get":{"summary":"Get all event subscriptions for a tenant","description":"Lists the event subscriptions in the caller's tenant. A subscription delivers real-time notifications to an endpoint when platform events occur, such as a record created or a job completed.","operationId":"eventSubscriptionFindMany","tags":["Tenants"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventSubscriptionFindManyResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Create an event subscription for a tenant

> Creates an event subscription in the caller's tenant. Give the event types to subscribe to and the endpoint that receives the notifications.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"CreateEventSubscriptionRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IEventSubscriptionCreateOneRequest","description":"Creates an event subscription in the tenant.","type":"object","additionalProperties":false,"required":["data"],"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"},"data":{"type":"object","additionalProperties":false,"required":["type","attributes"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["eventSubscriptions"]},"attributes":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"type":{"description":"Where the server delivers events.\n- `sqs`: an Amazon SQS queue, with its ARN in `endpoint`.\n- `webhook`: an HTTP or HTTPS URL.","type":"string","enum":["sqs","webhook"]},"endpoint":{"description":"The SQS queue ARN or the webhook URL.","type":"string"},"format":{"$ref":"#/components/schemas/EventSubscriptionFormat"},"resourceType":{"$ref":"#/components/schemas/EventSubscriptionResourceType"},"filter":{"$ref":"#/components/schemas/RecordEventSubscriptionFilter"}},"required":["name","type","endpoint","resourceType","filter"]}}}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"EventSubscriptionFormat":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IEventSubscriptionFormat","description":"Message format.\n- `cloudevents`: CloudEvents 1.0 events (see `RecordCloudEvent`). `filter` selects which events you receive.","type":"string","enum":["cloudevents"]},"EventSubscriptionResourceType":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IEventSubscriptionResourceType","description":"The resource type the subscription receives events for. Each subscription covers exactly one.","type":"string","enum":["records"]},"RecordEventSubscriptionFilter":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IRecordEventSubscriptionFilter","description":"Selects the record events a records subscription receives. The subscription gets every event type in `eventTypes` for every record; `updated` can narrow `record.updated`. Allows at most 150 combinations: one per event type other than `record.updated`, plus, for `record.updated`, the product of the value counts of each `updated` property.","type":"object","additionalProperties":false,"required":["eventTypes"],"properties":{"eventTypes":{"description":"Event types to receive, as an explicit list. You never receive event types added later until you add them.\n- `record.created`: a new record.\n- `record.updated`: any other write to a record, such as a field value, its title, lifecycle status, parent or position. Each save sends one event that lists every key it saved.\n- `record.deleted`: a record moved to the deleted records.\n- `record.restored`: a record came back from the deleted records.\n- `record.purged`: a record's permanent deletion.","type":"array","uniqueItems":true,"items":{"type":"string","enum":["record.created","record.updated","record.deleted","record.restored","record.purged"]}},"updated":{"description":"Narrows `record.updated` events. Use it only when `eventTypes` includes `record.updated`. An event must match every property you set, and any one value within a property. An omitted property matches any value. Set `lifecycleStatuses` or `lifecyclePhases`, not both.","type":"object","additionalProperties":false,"properties":{"lifecycleStatuses":{"description":"Only updates to records whose lifecycle status, after the change, is one of these ids.","type":"array","uniqueItems":true,"items":{"type":"string"}},"lifecyclePhases":{"description":"Only updates to records whose lifecycle phase, after the change, is one of these ids.","type":"array","uniqueItems":true,"items":{"type":"string"}},"savedKeys":{"description":"Only updates that saved at least one of these attribute or field keys.","type":"array","uniqueItems":true,"items":{"type":"string"}}}}}},"EventSubscriptionCreateOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"IEventSubscriptionCreateOneResponse","description":"The created event subscription and its self link.","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"allOf":[{"$ref":"#/components/schemas/BaseResource"},{"type":"object","properties":{"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/EventSubscriptionAttributes","required":["name","type","endpoint"]}]}},"required":["attributes"],"additionalProperties":false}]},"links":{"type":"object","properties":{"self":{"type":"string"}},"required":["self"],"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResource":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResource","description":"A resource identifier. Every resource object carries a unique `id` and a `type`, the resource type name such as `records` or `contributors`.","type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":false},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"EventSubscriptionAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IEventSubscriptionAttributes","description":"An event subscription's attributes.","type":"object","additionalProperties":false,"required":["name","type","endpoint","subscriptionArn"],"properties":{"name":{"type":"string"},"type":{"type":"string"},"endpoint":{"type":"string"},"subscriptionArn":{"type":"string"},"format":{"$ref":"#/components/schemas/EventSubscriptionFormat"},"resourceType":{"$ref":"#/components/schemas/EventSubscriptionResourceType"},"filter":{"$ref":"#/components/schemas/RecordEventSubscriptionFilter"}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false}}},"paths":{"/eventSubscriptions":{"post":{"summary":"Create an event subscription for a tenant","description":"Creates an event subscription in the caller's tenant. Give the event types to subscribe to and the endpoint that receives the notifications.","operationId":"eventSubscriptionCreateOne","tags":["Tenants"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEventSubscriptionRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventSubscriptionCreateOneResponse"}}}}}}}}}
```

## Get an event subscription by ID

> Returns one event subscription from the caller's tenant.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"EventSubscriptionFindOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IEventSubscriptionFindOneResponse","description":"An event subscription.","type":"object","additionalProperties":false,"required":["data","links","jsonapi"],"properties":{"data":{"type":"object","required":["id","type","attributes"],"additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["eventSubscriptions"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"$ref":"#/components/schemas/EventSubscriptionAttributes"}]}}},"links":{"type":"object","required":["self"],"properties":{"self":{"type":"string"}},"additionalProperties":false},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"EventSubscriptionAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IEventSubscriptionAttributes","description":"An event subscription's attributes.","type":"object","additionalProperties":false,"required":["name","type","endpoint","subscriptionArn"],"properties":{"name":{"type":"string"},"type":{"type":"string"},"endpoint":{"type":"string"},"subscriptionArn":{"type":"string"},"format":{"$ref":"#/components/schemas/EventSubscriptionFormat"},"resourceType":{"$ref":"#/components/schemas/EventSubscriptionResourceType"},"filter":{"$ref":"#/components/schemas/RecordEventSubscriptionFilter"}}},"EventSubscriptionFormat":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IEventSubscriptionFormat","description":"Message format.\n- `cloudevents`: CloudEvents 1.0 events (see `RecordCloudEvent`). `filter` selects which events you receive.","type":"string","enum":["cloudevents"]},"EventSubscriptionResourceType":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IEventSubscriptionResourceType","description":"The resource type the subscription receives events for. Each subscription covers exactly one.","type":"string","enum":["records"]},"RecordEventSubscriptionFilter":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IRecordEventSubscriptionFilter","description":"Selects the record events a records subscription receives. The subscription gets every event type in `eventTypes` for every record; `updated` can narrow `record.updated`. Allows at most 150 combinations: one per event type other than `record.updated`, plus, for `record.updated`, the product of the value counts of each `updated` property.","type":"object","additionalProperties":false,"required":["eventTypes"],"properties":{"eventTypes":{"description":"Event types to receive, as an explicit list. You never receive event types added later until you add them.\n- `record.created`: a new record.\n- `record.updated`: any other write to a record, such as a field value, its title, lifecycle status, parent or position. Each save sends one event that lists every key it saved.\n- `record.deleted`: a record moved to the deleted records.\n- `record.restored`: a record came back from the deleted records.\n- `record.purged`: a record's permanent deletion.","type":"array","uniqueItems":true,"items":{"type":"string","enum":["record.created","record.updated","record.deleted","record.restored","record.purged"]}},"updated":{"description":"Narrows `record.updated` events. Use it only when `eventTypes` includes `record.updated`. An event must match every property you set, and any one value within a property. An omitted property matches any value. Set `lifecycleStatuses` or `lifecyclePhases`, not both.","type":"object","additionalProperties":false,"properties":{"lifecycleStatuses":{"description":"Only updates to records whose lifecycle status, after the change, is one of these ids.","type":"array","uniqueItems":true,"items":{"type":"string"}},"lifecyclePhases":{"description":"Only updates to records whose lifecycle phase, after the change, is one of these ids.","type":"array","uniqueItems":true,"items":{"type":"string"}},"savedKeys":{"description":"Only updates that saved at least one of these attribute or field keys.","type":"array","uniqueItems":true,"items":{"type":"string"}}}}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false}}},"paths":{"/eventSubscriptions/{eventSubscriptionId}":{"get":{"summary":"Get an event subscription by ID","description":"Returns one event subscription from the caller's tenant.","operationId":"eventSubscriptionFindOne","tags":["Tenants"],"parameters":[{"name":"eventSubscriptionId","description":"The event subscription to retrieve.","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventSubscriptionFindOneResponse"}}}}}}}}}
```

## Delete an event subscription by ID

> Permanently deletes an event subscription. Its endpoint stops receiving notifications for the subscribed event types.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"WriteMetaOnlyRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteMetaOnlyRequest","description":"An optional body with only audit metadata, for mutations that take no other body, such as deletes. Use it to send `meta.audit.source` and `meta.audit.reason`.","type":"object","additionalProperties":false,"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"}}},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false}}},"paths":{"/eventSubscriptions/{eventSubscriptionId}":{"delete":{"summary":"Delete an event subscription by ID","description":"Permanently deletes an event subscription. Its endpoint stops receiving notifications for the subscribed event types.","operationId":"eventSubscriptionDeleteOne","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteMetaOnlyRequest"}}}},"tags":["Tenants"],"parameters":[{"name":"eventSubscriptionId","description":"The event subscription to delete.","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Create a tenant job

> Starts a long-running job in the caller's tenant. The request body sets the job type. Poll the returned job ID with \`GET /backgroundJobs/{jobId}\`.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"TenantJobCreateOneRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantJobCreateOneRequest","description":"Starts a tenant background job of the given `type` with its `parameters`.","type":"object","definitions":{"ITenantFullDeleteJobParameters":{"type":"object","properties":{"tenantIdToDelete":{"type":"string","description":"The tenant to delete."}},"required":["tenantIdToDelete"],"additionalProperties":false},"ITenantSyncSystemPoliciesJobParameters":{"type":"object","properties":{"tenantIdToSync":{"type":"string","description":"Syncs only this tenant. Omit to sync all tenants."}},"additionalProperties":false}},"properties":{"meta":{"$ref":"#/components/schemas/WriteRequestMeta"},"data":{"allOf":[{"$ref":"#/components/schemas/BaseCreateRequest"},{"type":"object","properties":{"attributes":{"type":"object","properties":{"type":{"type":"string","enum":["fullTenantDelete","syncSystemPolicies"],"description":"The job to start."},"parameters":{"oneOf":[{"$ref":"#/components/schemas/ITenantFullDeleteJobParameters"},{"$ref":"#/components/schemas/ITenantSyncSystemPoliciesJobParameters"}]}},"required":["type","parameters"],"additionalProperties":false}},"required":["attributes"],"additionalProperties":false}]}},"required":["data"],"additionalProperties":false},"WriteRequestMeta":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IWriteRequestMeta","description":"Audit metadata for a write request. `audit.source` names the surface that sent it, such as `studio-web`, `studio-mcp`, `api` or `system`; `audit.reason` is a free-text justification.","type":"object","additionalProperties":false,"properties":{"audit":{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","maxLength":64},"reason":{"type":"string","maxLength":256}}}}},"BaseCreateRequest":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseCreateRequest","description":"Base shape for create requests. `type` must match the target resource type. Omit `id` to let the server generate one.","type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["type"]},"ITenantFullDeleteJobParameters":{"type":"object","properties":{"tenantIdToDelete":{"type":"string","description":"The tenant to delete."}},"required":["tenantIdToDelete"],"additionalProperties":false},"ITenantSyncSystemPoliciesJobParameters":{"type":"object","properties":{"tenantIdToSync":{"type":"string","description":"Syncs only this tenant. Omit to sync all tenants."}},"additionalProperties":false},"TenantJobCreateOneResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantJobCreateOneResponse","description":"The started job and its `self` link.","type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/BaseCreateRequest"},{"additionalProperties":false,"properties":{"id":{"type":"string"},"attributes":{"$ref":"#/components/schemas/TenantJob"},"links":{"type":"object","properties":{"self":{"type":"string"}},"required":["self"]},"relationships":{"type":"object","properties":{"tenant":{"$ref":"#/components/schemas/TenantRelationship"}},"required":["tenant"],"additionalProperties":false}},"required":["id","attributes","links","relationships"]}]},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}},"required":["data","jsonapi"],"additionalProperties":false},"TenantJob":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantJob","description":"A tenant-level background job, such as a full tenant delete.","type":"object","allOf":[{"$ref":"#/components/schemas/BackgroundJobAttributes"},{"type":"object","properties":{"type":{"type":"string","enum":["fullTenantDelete","syncSystemPolicies"]},"parameters":{"type":"object","additionalProperties":true}},"required":["type","parameters"],"additionalProperties":false}],"required":["arn","status","created","updated","type","parameters"],"additionalProperties":false},"BackgroundJobAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBackgroundJobAttributes","description":"Attributes of a background job, a long-running operation such as a contributor delete or tenant data export. They carry the status, job type and parameters, plus the output on completion, error details on failure, and item counts for batch jobs.","type":"object","allOf":[{"$ref":"#/components/schemas/BaseResourceAttributes"},{"type":"object","properties":{"type":{"type":"string"},"parameters":{"type":"object"},"status":{"$ref":"#/components/schemas/BackgroundJobStatus"},"output":{"type":"object","properties":{"errorsAvailable":{"type":"boolean","description":"True when GET /backgroundJobs/{jobId}/errors can download the job's per-item error files."}}},"totalItemsCount":{"type":"integer","minimum":0,"description":"Total items in a batch job, when applicable."},"successItemsCount":{"type":"integer","minimum":0,"description":"Items the batch job processed successfully, when applicable."},"failedItemsCount":{"type":"integer","minimum":0,"description":"Items that failed in a batch job, when applicable."},"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"],"additionalProperties":false}},"required":["type","parameters","status"],"additionalProperties":false}],"additionalProperties":false},"BaseResourceAttributes":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBaseResourceAttributes","description":"Timestamps on every resource's attributes, as ISO 8601 date-times. `created` marks the resource's creation; `updated` marks its last change.","type":"object","additionalProperties":false,"required":["created","updated"],"properties":{"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"}}},"BackgroundJobStatus":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IBackgroundJobStatus","description":"A background job's status. `RUNNING` and `PENDING_REDRIVE` (queued for retry) are still in progress; `SUCCEEDED`, `FAILED`, `TIMED_OUT` and `ABORTED` are final.","type":"string","enum":["ABORTED","FAILED","PENDING_REDRIVE","RUNNING","SUCCEEDED","TIMED_OUT"]},"TenantRelationship":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ITenantRelationship","description":"A relationship to a tenant","type":"object","properties":{"data":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["tenants"]}},"required":["id","type"]},"links":{"$ref":"#/components/schemas/LinksRelated"}},"required":["data","links"],"additionalProperties":false},"LinksRelated":{"$schema":"http://json-schema.org/draft-07/schema#","title":"ILinks","description":"A JSON:API links object with an absolute or relative 'related' link","type":"object","required":["related"],"properties":{"related":{"type":"string"}},"additionalProperties":false},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false},"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}}}},"paths":{"/tenantJobs":{"post":{"summary":"Create a tenant job","description":"Starts a long-running job in the caller's tenant. The request body sets the job type. Poll the returned job ID with `GET /backgroundJobs/{jobId}`.","operationId":"tenantJobCreateOne","tags":["Tenants"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantJobCreateOneRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantJobCreateOneResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Create the usage plan for a tenant

> Creates the usage plan for the tenant.

```json
{"openapi":"3.0.3","info":{"title":"Fabric API - Audit","version":"0.9.2817"},"tags":[{"name":"Tenants","description":"Manage policies, security tags and other resources within a tenant. A tenant is an organization, such as a company or studio, that owns its own resources. A security policy defines what a role can do in a tenant. A security tag labels resources to restrict access."}],"servers":[{"url":"{protocol}://{domain}/{basePath}","variables":{"protocol":{"enum":["http","https"],"default":"https"},"domain":{"default":"api.studio.fabricdata.com"},"basePath":{"default":"v1"}}}],"security":[{"jwt-apikey-authorizer":[]}],"components":{"securitySchemes":{"jwt-apikey-authorizer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"ErrorResponse":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IErrorResponse","description":"The body of a failed request: an `errors` array with one or more error objects.","type":"object","required":["errors","jsonapi"],"additionalProperties":false,"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/Error"}},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"}}},"Error":{"$schema":"http://json-schema.org/draft-07/schema#","title":"IError","description":"One JSON:API error object. `status` is the HTTP status code as a string, `title` a short summary and `detail` optional context. `meta` can carry structured conflict or authorization details.","type":"object","additionalProperties":false,"required":["status","title"],"properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string","description":"A stable code for the problem that you can act on, when the operation documents one."},"detail":{"type":"string"},"source":{"type":"object","description":"A JSON Pointer to the request field that caused the error, such as `/data/attributes/title`.","properties":{"pointer":{"type":"string"}}},"meta":{"type":"object","additionalProperties":true,"properties":{"stack":{"type":"string","description":"The error's stack trace. Non-production environments only."},"conflictItems":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"unauthorizedItems":{"type":"array","items":{"type":"string"}}}}}},"JsonApiVersion":{"type":"object","description":"The JSON:API version this document conforms to.","properties":{"version":{"type":"string"}},"required":["version"],"additionalProperties":false}}},"paths":{"/usagePlans":{"post":{"summary":"Create the usage plan for a tenant","description":"Creates the usage plan for the tenant.","operationId":"usagePlanCreateOne","tags":["Tenants"],"parameters":[{"name":"tenantId","description":"The tenant to create the usage plan for.","in":"query","required":true,"style":"form","explode":false,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict: the tenant already has a usage plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```
