Getting Started
The Sparta API is based on REST principles. It uses standard HTTP response codes and verbs, and token-based authentication. Your access and use of Sparta, including the Sparta API and any data included therein, is subject to the terms and conditions of your organisation’s agreement with us.
If you're just getting started with our API, read our quick-start guides.
Getting Access
You need a Sparta account with API access. Please contact your Customer Success manager or Sparta sales representative to discuss how to acquire a Sparta API license, or send us an email to [email protected]
Authentication
You can get API tokens to authenticate any API action described in this documentation, through the authenticate endpoint. The token will have an expiry time, so it is best practice to acquire a new token after expiry.
We recommend you limit the number of people who have access to the token as per the commercial license agreement you will have Sparta for API usage. Also, please bear in mind rate limits.
Security
You must never use API tokens in the frontend of your application or malicious users could discover them in your source code. You should only use them on your server.
- We strongly suggest a password rotation policy on your Sparta platform credentials.
- We recommend a maximum of 90 days.
API Reference
Learn through our full API reference area located at Sparta API Reference.
Request and response formats
- You should use a Content-Type:
application/json
header with allPUT
andPOST
requests. - Responses return JSON with a consistent structure, except downloads.
- You must make all your requests to the API over HTTPS and TLS 1.2, with Server Name Indication enabled. Any requests made over HTTP will fail.
- Text fields support UTF-8, but do not allow the following characters
^!#$%*=<><>;{}"
.
Postman Collections
You can run the Sparta API collection in Postman:
In your Postman environment, you'll need to define the following values:
email
: Email of your Sparta account.password
: Password of your Sparta account.url
: https://api.sparta.app/v2.
You can read more in Postman's documentation about managing environments, and we strongly encourage using the Secret Variable Type to protect your Sparta credentials.
Pagination
Pagination is available on most of the API endpoints using the following approach:
pageSize
: the number of results to be returned.page
: the page index to be returned.
For example, if there are 23 results available and the pageSize
is set at 10 by setting page=1
you will retrieve the first 10 results, then to get the next 10 you simply call the endpoint again with page=2
, and for the last 3 results it would be page=3
.
Versioning Policy
Refer to our API versioning guide for details on Sparta's versioning policy.
Updated 3 months ago