Authentication
Send the key on every call and pick the right access for each system.
How to send the key
Send the key in the Authorization header of every call:
Authorization: Bearer pfx_live_...The key identifies your organization: there is no organization header to send. A key sent in the URL or in the body is ignored.
The full value is shown only once, when the key is created. Store it somewhere safe and never put it in a URL, in a request body or in code that runs in a browser or in a distributed app. If it gets lost or leaks, create another key and revoke the old one.
Key access
| Access | What it allows |
|---|---|
| Read only | Look up customers, service requests and work orders. |
| Read and create | Everything Read only allows, plus registering and updating customers and opening service requests. |
Work orders are read-only with any access. The access is set when the key is created; to change it, create another key.
Expiry and revocation
- Expiry: 30 days, 90 days, 1 year (default) or no expiration.
- Revoking takes effect immediately: the next call with the key is already refused. Whatever the key already registered or opened stays in ProFieldX.
- Each organization can have up to 10 active keys. Use one key per system, so you can revoke one without stopping the others.
- To replace a key, create the new one, update your system and only then revoke the old one.
Authentication responses
| Status | Code | When |
|---|---|---|
| 401 | UNAUTHENTICATED | The key is missing, malformed or unknown. |
| 401 | API_KEY_REVOKED | The key was revoked. |
| 401 | API_KEY_EXPIRED | The key is past its expiry. |
| 403 | PERMISSION_DENIED | The key access does not include this operation, such as registering a customer with a Read only key. |
| 403 | BILLING_FEATURE_REQUIRED | The current plan of the organization does not include the API. The keys work again once the organization subscribes to a paid plan. |
Many attempts without a valid key from the same IP address are blocked for a short while. The numbers are in Rate limits.