---
updatedAt: 2026-05-14T14:36:34.000Z
agentTools:
  projectIndex: https://docs.talkdesk.com/llms.txt
---

# Obtain a new authorization code

Obtain a new authorization code

# OpenAPI definition

```json
{
  "openapi": "3.0.2",
  "info": {
    "title": "Authentication API",
    "version": "5.12.71",
    "description": "OAuth and identity endpoints served from the Talkdesk Identity host. Use `{account_name}.talkdeskid.com` as the base URL.",
    "contact": {
      "name": "Talkdesk",
      "url": "https://talkdesk.com"
    }
  },
  "servers": [
    {
      "url": "https://{account_name}.talkdeskid.com",
      "description": "United States (td-us-1)",
      "variables": {
        "account_name": {
          "default": "account-name",
          "description": "The customer's Talkdesk account subdomain."
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Authentication",
      "description": "Authentication API"
    }
  ],
  "paths": {
    "/oauth/authorize": {
      "get": {
        "operationId": "oauth-authorize-get",
        "summary": "Obtain a new authorization code",
        "description": "Obtain a new authorization code",
        "parameters": [
          {
            "name": "client_id",
            "in": "query",
            "description": "The client ID provided in your client information set",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "description": "A registered redirect URI where the user is going to be redirected to with the authorization code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "response_type",
            "in": "query",
            "description": "The value \"code\" tells the authorization server that the authorization code flow is initiating",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "A space-separated list of scopes (URL encoded) the client is requesting access to",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "description": "A random string, used to prevent CSRF attacks, that will be passed through untouched to the callback with the code",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nonce",
            "in": "query",
            "description": "A random string, used to prevent replay attacks, that will be passed through untouched to the ID token",
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Authentication"
        ],
        "responses": {
          "302": {
            "description": "The redirect URI with a \"code\" and the \"state\" parameter provided in the request query parameter",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "header",
                    "error",
                    "error_description"
                  ],
                  "properties": {
                    "header": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "header": "OAuth Error",
                  "error": "invalid_grant",
                  "error_description": "Invalid redirect: null does not match one of the registered values: [https://oauth.pstmn.io/v1/callback]"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "header",
                    "error",
                    "error_description"
                  ],
                  "properties": {
                    "header": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "header": "OAuth Error",
                  "error": "invalid_client",
                  "error_description": "Bad client credentials"
                }
              }
            }
          }
        }
      }
    }
  }
}
```