Appearance
Authentication
All API requests must include a valid Bearer Token in the Authorization header.
Bearer Token
Authorization: Bearer {your-token}Generating a Token
API tokens are generated from the backoffice user settings page:
https://dashboard.wedocod.com/settings/api-keysWhen generating a token, you can select specific permissions (scopes) to control what the token can access.
Token Scopes
Scopes follow {action} {resource} (see App\Enums\ApiPermission\ApiPermissionElement). Admin and Media buyer API keys can enable the resources below (Media buyer omits cities).
| Resource | Scopes available when creating a token |
|---|---|
leads | view-any, view, create, update, delete |
orders | view-any, view, create, update, delete |
leads-histories | view-any, view |
orders-histories | view-any, view |
products | view-any, view |
stocks | view-any, view |
stocks-histories | view-any, view |
warehouses | view-any, view |
shipping-companies | view-any, view |
invoices | view-any, view |
sourcings | view-any |
cities | view-any, view (Admin only — not Media buyer) |
teams | view-any, view |
tracking | view-any |
webhooks | view-any, view |
Example scope strings: view-any orders, update leads, view-any stocks-histories.
Notifications
Notifications (GET /notifications) use dashboard role permissions, not API-key checkboxes. The user behind the token must have notification permissions in the back office.
Media buyer
Media buyer tokens use the same scope list as Admin except cities, and order create is omitted from mobile token abilities (REST API scopes still follow what you select when creating the key).
You can assign a subset of scopes when generating a token to create least-privilege integrations.
