Create a company address
const url = 'https://api.fleet.co/platform/v1/addresses';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"first_name":"example","last_name":"example","phone":"example","phone_country":"FR","address1":"example","address2":"example","type":"HOME","zip":"example","city":"example","administrative_area":"IT-MI","state":"example","country":"FR","label":"example","comment":"example","is_default":false,"user_id":42}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.fleet.co/platform/v1/addresses \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "first_name": "example", "last_name": "example", "phone": "example", "phone_country": "FR", "address1": "example", "address2": "example", "type": "HOME", "zip": "example", "city": "example", "administrative_area": "IT-MI", "state": "example", "country": "FR", "label": "example", "comment": "example", "is_default": false, "user_id": 42 }'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”object
ISO 3166-1 alpha-2 country code
Example
FRState, province or prefecture, as its local code (MI) or ISO 3166-2 code (IT-MI). Required for US, CA, IT, AU, MX and JP; optional for ES; rejected elsewhere.
Example
IT-MIDeprecated: send administrative_area instead. Read only when administrative_area is absent and it names an area of the country.
ISO 3166-1 alpha-2 country code
Example
FREmployee who lives at this HOME address. An employee has one personal address: assigning this one replaces their previous link, and the address takes the employee’s name, email, and phone (a phone sent here also updates the employee).
Example
42Responses
Section titled “Responses”Created address
object
object
Address kind: OFFICE, HOME, PO_BOX or EXTERNAL_STORAGE
Legacy free-text state, no longer written: read administrative_area instead.
Local subdivision code
ISO 3166-2 subdivision code
ISO 3166-1 alpha-2 country code
Employee who lives at this HOME address; null for other addresses
Example
{ "data": { "administrative_area": "MI", "administrative_area_iso": "IT-MI", "country": "FR" }}Validation error, INVALID_ADDRESS when the administrative area is missing or does not belong to the country, or ADDRESS_NOT_HOME when user_id is sent for an address that is not HOME
Missing, invalid, or revoked API key
Example
UnauthorizedThe API key has READ scope; this operation needs WRITE
object
Example
{ "error": "INSUFFICIENT_SCOPE"}Resource not found; USER_NOT_FOUND when user_id is not an active user of the company
object
Example
{ "error": "COMPANY_NOT_FOUND"}Rate limit exceeded. The RateLimit-* headers give the limit and the reset time.
Example
Too many requests, please try again later.Unexpected server error
object
Example
{ "error": "INTERNAL_ERROR"}Rate limiting is temporarily unavailable; retry with backoff
object
Example generated
{ "message": "example"}
