Help Center How to create and manage API keys

How to create and manage API keys

An API key (token) lets an external system work with SMSBAT on behalf of your organization. The key is sent in the X-Authorization-Key header. You need it, for example, to connect the MyCode.Bot chat integration or to send messages through the SMSBAT API.

Each key belongs to one organization. Keys are created by the account administrator in the omni.smsbat.com dashboard.

Where the keys are

  1. In the left menu click Organizations.
  2. Press View on the organization’s card. The organization page opens on the Profile tab.
  3. Open the Api Keys tab.

The table shows Organization Name, Name (the app name), Description and Expire Date of every key. The key itself is not shown in the table: it is shown only once, when it is created.

Note

If the card also shows a Verify button, the organization is not verified yet: it has no active contract or its e-mail is not confirmed. View still opens the organization page. To finish the verification, press Verify and follow Verify your organization.

Step 1. Create a key

  1. On the Api Keys tab press Create Token.

  2. Fill in the dialog:

    FieldWhat to enter
    I agree to be bound by SMSBAT Developer TermsTurn the switch on. Without it the key is not created. The link opens the terms.
    Select an organizationThe organization the key works for. On the organization page it is already filled in. Required.
    App NameA name that tells you where the key is used, for example “MyCode.Bot” or “Website”.
    DescriptionOptional notes, for example who is responsible for the integration.
    Expire DateThe date the key stops working. By default it is one year from today.
  3. Press Create.

Step 2. Copy the key

After creation the window Your Token opens with the warning “Please note that the token will be shown only once. Copy it to a safe place”.

  1. Press the copy button next to the key. The message Token copied to clipboard appears.
  2. Paste the key into the integration settings or into a password manager right away.

If you close the window without copying, the key cannot be shown again. Remove it and create a new one.

Change the expiry date

Only the Expire Date of a key can be changed.

  1. In the table click the pencil icon in the key’s row (on a phone, the pencil on the key’s card).
  2. Choose a new date.
  3. Press the ✓ icon. The message Successfully was updated appears.

To change the app name or description, create a new key and remove the old one.

Remove (revoke) a key

  1. Select the key’s row (the round selector on the left).
  2. Press Remove.
  3. In the window “Are you sure to confirm?” press Confirm. The message Token removed successfully appears.

Integrations that use this key stop working with SMSBAT after it is removed. Put a new key into them first if you want to replace a key without downtime.

Find a key

Press Filters to show or hide the filters above the table:

  • Organization — show the keys of one organization;
  • Search — search by app name;
  • Document date — despite its label, this field filters keys by Expire Date.

Clear filter returns the filters to their initial state.

Keep your keys safe

  • Treat a key like a password: anyone who has it can use SMSBAT on behalf of your organization.
  • Do not send keys in chats or e-mails, do not publish them in code repositories or on web pages.
  • Create a separate key for each integration and give it a clear App Name. Then you can revoke one key without breaking the others.
  • Set a reasonable Expire Date and renew keys before they expire.
  • If a key may have been exposed, remove it at once and create a new one.

Common questions

I lost the key. Can I see it again? No, the key is shown only once. Create a new key, put it into the integration and remove the old one.

The Create button is inactive. Choose the organization in Select an organization.

I pressed Create, but nothing happened. Check that the I agree to be bound by SMSBAT Developer Terms switch is on; if it is off, the switch is highlighted in red and the key is not created.

The integration says the key is invalid. Check the Expire Date of the key and that the key was not removed. Make sure the integration sends it in the X-Authorization-Key header. API details are in the API documentation.

Is an API key the same as an operator login? No. Operators sign in to the chat with a login and password, see How to create operators. An API key is only for integrations.