Skip to main content

Accessing the API

The API is made available via Trust Stack Console. Console lets you manage your account, applications, and API keys. Before you can access the API, you’ll need to create an account, and a developer access key.

Authentication

All requests to the Trust Stack API must included a Authorization header with a value in the format of Bearer <access_key>. If you are using the Client SDKs, you will set the access key either via environment variable or when initialize the client. If you choose to use the API directly, you can set the access key in the header of your request yourself.

Organizations

An important concept in the Trust Stack is the Organization. An organization is a collection of users without your own application boundary. Learn more about organizations here. When using the API, you can specify the organization in the header of your request X-Organization-Id.

Content Types

The Trust Stack API always accepts JSON in request bodies and returns JSON in response bodies. You will need to set the Content-Type header to application/json in your request. If you are using the Client SDKs, you will not need to worry about this.

Examples

  • Curl
  • TypeScript
curl -X GET "https://api.truststack.dev/v1/organizations/create"  \
    --header "Authorization: Bearer <access_key>" \ 
    --header "Content-Type: application/json" \
    ---data \
'{
    "name": "ACME Farms"
}'