---
title: "Authorize"
method: POST
path: "/authz-service/api/authz"
tags: ["Authorization", "Authorization"]
---

# Authorize

`POST /authz-service/api/authz`

Authorize the provided request.

## Request body

- AuthzRequest — Represents an authorization request. Attributes: conversation_id (Optional[str]): The unique identifier for the conversation. This is the parent for all the prompts and replies in the thread. request_id (str): The unique identifier for the request. Both prompts and responses have unique requestIds and in a conversation, they will share the same conversationId. thread_id (str): If this is a reply or enriched_prompts, then threadId is the requestId of the prompt. This helps in associating the enriched_prompt and replies with the prompt. sequence_number (int): Sequence number of the messages within the request. E.g., user prompt might lead to multiple enriched prompts. Sequence starts from 1. application_key (str): AI application key. This is mandatory for all requests. Ideally, this should come from the plugin. client_application_key (str): Client application key. If not sent, unknown will be used. enforce (bool): Whether the actions are enforced or not. Defaults to True. user_id (str): The unique identifier for the user. request_type (str): The type of request. Valid values are: prompt, reply, enriched_prompt. traits (List[str]): List of traits. context (Optional[Dict[str, Any]]): Additional context as list of key-value pairs. request_date_time (datetime): Date and time of the request. If not sent by client, server will generate one and return in the response.
  - `conversationId` string, nullable
  - `requestId` string
  - `threadId` string
  - `sequenceNumber` integer
  - `applicationKey` string
  - `clientApplicationKey` string
  - `enforce` boolean
  - `userId` string
  - `requestType` string
  - `traits` string[]
  - `context` object, nullable
  - `requestDateTime` string, date-time

## Response `200`

Successful Response

- AuthzResponse — Represents an authorization response. Attributes: authorized (bool): Whether the request is authorized or not. enforce (bool): Whether to enforce the request or not. request_id (str): Id of the request. request_date_time (datetime): Date and time of the request. user_id (str): Id of the user. application_name (str): Name of the AI application. masked_traits (Optional[Dict[str, str]]): Traits to be masked. context (Optional[Dict[str, Any]]): Additional context as list of key-value pairs. status_code (int): Request status code. Zero means success. Non-zero means failure. status_message (str): Message associated with the status code. reason (str): Reason for the status code. paig_policy_ids (List[int]): List of Paig audit ids.
  - `authorized` boolean
  - `enforce` boolean
  - `requestId` string
  - `requestDateTime` string, date-time
  - `userId` string
  - `applicationName` string
  - `maskedTraits` object, nullable
  - `context` object, nullable
  - `statusCode` integer
  - `statusMessage` string
  - `reason` string
  - `paigPolicyIds` integer[]

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/privacera/apis/paig-server.md) · [All operations](https://skmtc.net/privacera/apis/paig-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/privacera/paig-server/versions/e3d2c30ceace/schema)
