User guides
Profile management
Personal Access Token

Personal Access Token

Use Personal Access Token to integrate your resources with other services

The Personal Access Token (PAT) serves as a versatile tool for integrating SiteBox with various external providers. This key element allows you to execute specific actions, facilitating processes such as website deployment. Learn how to securely create and manage PAT for effective integration with CI/CD services on this dedicated page.

How to create a PAT?

  1. Go to the PAT settings page in the SiteBox Dashboard. PAT settings page in the SiteBox Dashboard

  2. Click the "Add a new token" button to trigger the popup form. Add a new token button in the PAT settings page

  3. Fill up the form by providing the token name, optional description, expiration date and scope. Create a new PAT form

  4. Click "Next step" to complete the form. On the summary page, you will see your PAT - ensure you have it copied as it won't be displayed any more. Summary popup with PAT

How to regenerate PAT?

Each Personal Access Token (PAT) comes with an expiration date for security reasons, limited to a maximum of 1 year. In case you forget your token or need to regenerate it for any reason, keep in mind that you can only view the token once. Regenerating the token will render the previous one inactive. This ensures the continuous security of your SiteBox account and its associated environments.

  1. Go to the PAT settings page in the SiteBox Dashboard. PAT settings page in the SiteBox Dashboard

  2. Choose a PAT you want to regenerate, hover over gear shaped icon on the right and click "Regenerate token". Regenerate token icon on PAT screen in SiteBox Dashboard

  3. Provide a new expiration date and submit the form. New PAT will be displayed on the summary popup.

How to remove a PAT?

PAT token can be removed at any time. It becomes immediately inactive and no one will be able to use it anymore.

  1. Go to the PAT settings page in the SiteBox Dashboard.

  2. Choose a PAT you want to remove, hover over gear shaped icon on the right and click "Remove token".

  3. Confirm the removal in the popup. Remove PAT confirmation modal

How to use PAT?

The Personal Access Token can be used in GitHub Actions or other custom integrations that allow HTTP requests to be made to our API.

Trigger snapshot

This endpoint enables triggering a snapshot in a specific environment.

Request
Variable
URL
https://api.statik.space/api/v5/companies/$COMPANY_ID/projects/$PROJECT_ID/backends/$BACKEND_ID/backups
authorization header
Bearer $PAT
body
{"structure":["database","assets"]}

Available values: database, assets, codebase

COMPANY_ID

You can find the Company ID in the dashboard URL after opening a specific environment.

PROJECT_ID

You can find the Project ID in the dashboard URL after opening a specific environment.

BACKEND_ID

You can find the Backend ID in the dashboard URL after opening a specific environment.

PAT

The PAT (Personal Access Token) can be generated on the profile page.

Example request

curl "https://api.statik-stg.space/api/v5/companies/$COMPANY_ID/projects/$PROJECT_ID/backends/$BACKEND_ID/backups" \
  -H 'content-type: application/json' \
  -H "authorization: Bearer $PAT" \
  --data-raw '{"structure":["database","assets"]}'

Response status codes:

  • 201 - snapshot triggered
  • 4xx - error (check the response for more details)

Trigger deployment

This endpoint enables triggering a deployment in a specific environment.

Request
Variable
URL
https://api.statik.space/api/v5/companies/$COMPANY_ID/projects/$PROJECT_ID/backends/$BACKEND_ID/deployments
authorization header
Bearer $PAT
body
{
    "trigger": "ci",
    "codebase":"git",
    "database": "",
    "assets": ""
}

Available values:

  • trigger (string): Deployment trigger type
  • codebase (string): Backup ID - used for codebase (if empty, it will be set to 'git')
  • database (string): Backup ID - used for database
  • assets (string): Assets ID - used for assets

Backup ID is returned after creating snapshot

COMPANY_ID

You can find the Company ID in the dashboard URL after opening a specific environment.

PROJECT_ID

You can find the Project ID in the dashboard URL after opening a specific environment.

BACKEND_ID

You can find the Backend ID in the dashboard URL after opening a specific environment.

PAT

The PAT (Personal Access Token) can be generated on the profile page.

Example request

curl "https://api.statik.space/api/v5/companies/$COMPANY_ID/projects/$PROJECT_ID/backends/$BACKEND_ID/deployments" \
  -H 'content-type: application/json' \
  -H "authorization: Bearer $PAT" \
  --data-raw '{"trigger": "ci", "codebase":"git"}'

Response status codes:

  • 201 - deployment triggered
  • 4xx - error (check the response for more details)