API/Authentication
Get started
Authentication
The EasyFreelance API uses an API key and a token to identify and authenticate requests. Both are generated in the Web Panel.
Authentication is done with a token-based HTTP Authentication scheme. For a request to be authorised, the token must be in Authorization-header, prefixed with the text Bearer and a space. In addition, send the partner's API key in the header API-key.
Note that you receive separate API keys and tokens for production and test environments. Keys from one environment do not work in the other.
The API key and the token give access to several functions in the system, and must therefore be kept secure. Do not share them in publicly accessible places – such as GitHub, client-side code or other open systems. If you need to replace them, generate new ones in Web Panel.
Headers
| Header | Value | Description | |
|---|---|---|---|
Authorization | Bearer <token> | required | Personal access token (Sanctum) from the API settings. |
API-key | <uuid> | required | The partner's API key. Same place as the token. |
Content-Type | application/json | optional | Required when the request has a JSON body. |
Accept | application/json | optional | Recommended, so that errors are returned as JSON and not as HTML. |
Idempotency-key | <uuid> | optional | See Idempotency. Recommended on POST /payouts. |
Example
Replace <token> and <api-key> with your own values.
curl --location --request POST 'https://test.easyfreelance.no/api/v1/users' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer T8Cf2oWpDhPpYq2uE2JWRHaVdqsC3RJJTsdNSoGMhLxhE1Z3w7L9UVMW4T8owhIF' \ --header 'API-key: fd612e61-de98-4bb7-a636-cfc66bdd61ea' \ --header 'Idempotency-key: 6922d7be-c098-11ec-9d64-0242ac120004' \ --data '{"email":"[email protected]"}'
Missing or invalid authentication
If the headers are missing, or the token has expired or been revoked, the API responds with 401 Unauthorized with Laravel's standard format for API routes.
{
"message": "Unauthenticated."
}Environments
Rate limiting
All authenticated traffic from the same API identity shares a single rolling limit of 500 requests per minute across all /api/v1-routes. If it is exceeded, the API responds 429 Too Many Requests, optionally with the header Retry-After.