Personal Access Token
Use Personal Access Token to integrate your resources with other servicesThe 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?
-
Go to the PAT settings page in the SiteBox Dashboard.
-
Click the "Add a new token" button to trigger the popup form.
-
Fill up the form by providing the token name, optional description, expiration date and scope.
-
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.
Remember to store your Personal Access Token (PAT) in a secure location. This token grants access to all environments accessible to you. Safeguarding your PAT is crucial for maintaining the security of your SiteBox account and the associated environments.
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.
-
Go to the PAT settings page in the SiteBox Dashboard.
-
Choose a PAT you want to regenerate, hover over gear shaped icon on the right and click "Regenerate token".
-
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.
-
Go to the PAT settings page in the SiteBox Dashboard.
-
Choose a PAT you want to remove, hover over gear shaped icon on the right and click "Remove token".
-
Confirm the removal in the popup.
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.
Variable | |
---|---|
URL |
|
authorization header |
|
body |
Available values: |
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.
Variable | |
---|---|
URL |
|
authorization header |
|
body |
Available values:
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)