API
Authentication

User

13min
authenticate to begin, authentication requires you to generate your non expiring secret key the secret key uniquely identifies your account it is used to generate temporary bearer tokens , which are required to authenticate all api requests think of it as your private access token — it verifies your identity and authorizes the system to perform actions on your behalf, such as sending data, retrieving transcripts, or calling tools your secret key is displayed only once for security reasons if you do not save it, you will have to delete it and generate a new one, potentially disrupting your access generating secret key via interface you can generate your secret key by navigating to the "manage account" menu this menu is accessible by clicking on your name in the top right of the interface click on "generate" button and follow the instructions in the "secret key" section manage account > generate obtaining the bearer token this section describes how you can obtain an authentication bearer token the bearer token is a temporary access token used to authenticate your api requests it is obtained by calling the /auth/token endpoint with your email address and secret key the token is valid for 7 days for security, tokens must be refreshed periodically prerequisites before you can obtain an authentication bearer token, you must have the following email address the email address you used to generate your secret key secret key your unith api secret key steps to obtain your authentication bearer token, use the /auth/token endpoint with the post method endpoint /auth/token method post description retrieves an authentication bearer token request headers accept application/json content type application/json request body { "email" "your email address", // replace with your registered email address "secretkey" "your secret key" // replace with your unith api secret key } request parameters email (string, required) your registered email address secretkey (string, required) your unith api secret key request body curl x 'post' \\ 'https //platform api unith ai/auth/token' \\ h 'accept application/json' \\ h 'content type application/json' \\ d '{ "email" "your email address", "secretkey" "your secret key" }' replace "your email address" and "your secret key" with your actual email address and secret key response status code 200 (ok) response body { "token" "your authentication bearer token" // the authentication bearer token } response parameters token (string) the authentication bearer token this token must be included in the authorization header of subsequent api requests expiration bearer tokens expire after 7 days your application will need to obtain a new token after this period by repeating the process described above error handling the api will return standard http error codes for invalid requests 401 unauthorized indicates that the email address or secret key is invalid 500 internal server error indicates a server error use the auth/token endpoint with your secret key to generate a bearer token bearer tokens expire after 7 days if your application requires a bearer token, regenerate one using this endpoint and your secret key every 7 days managing secret key via api if you forgot your secret key, you need to follow these steps delete your existing secret key using /user/delete secret key https //platform api unith ai/api/#/user/usercontroller deletesecretkey curl x 'delete' \\ 'https //platform api unith ai/user/delete secret key' \\ h 'accept application/json' \\ h 'authorization bearer 12345' generate a new secret key using /user/generate secret key https //platform api unith ai/api/#/user/usercontroller generatesecretkey curl x 'put' \\ 'https //platform api unith ai/user/generate secret key' \\ h 'accept application/json' \\ h 'authorization bearer 12345'