Skip to main content
POST
/
api-keys
Create an API key
curl --request POST \
  --url https://business.tgo-eg.com/api/v1/api-keys \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "name": "Production integration",
  "scopes": [
    "messages.send",
    "messages.read"
  ],
  "expires_in_days": 90
}
'
{
  "data": {
    "id": 123,
    "name": "<string>",
    "prefix": "<string>",
    "scopes": [
      "<string>"
    ],
    "status": "active",
    "expires_at": "2023-11-07T05:31:56Z",
    "last_used_at": "2023-11-07T05:31:56Z"
  },
  "plain_text_key": "tgo_Rm9vQmFyQmF6..."
}

Authorizations

X-Api-Key
string
header
required

Body

application/json
name
string
required
Example:

"Production integration"

scopes
enum<string>[]
Available options:
*,
contacts.lookup,
messages.send,
messages.read,
usage.read
Example:
["messages.send", "messages.read"]
expires_in_days
integer
default:90
Required range: 1 <= x <= 365

Response

API key created. The plain text key is returned in this response.

data
object
plain_text_key
string
Example:

"tgo_Rm9vQmFyQmF6..."