Skip to content

Create a company address

POST
/addresses
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 }'
Media typeapplication/json
object
first_name
required
string
>= 1 characters
last_name
required
string
>= 1 characters
phone
required
string
>= 1 characters
phone_country
required

ISO 3166-1 alpha-2 country code

string

Example

FR
address1
required
string
>= 1 characters <= 255 characters
address2
string
>= 1 characters <= 70 characters
type
string
Allowed values: HOME OFFICE PO_BOX EXTERNAL_STORAGE
zip
required
string
>= 1 characters
city
required
string
>= 1 characters
administrative_area

State, 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.

string
>= 1 characters

Example

IT-MI
state

Deprecated: send administrative_area instead. Read only when administrative_area is absent and it names an area of the country.

string
country

ISO 3166-1 alpha-2 country code

string
default: FR

Example

FR
label
required
string
>= 1 characters
comment
string
>= 1 characters
is_default
boolean
user_id

Employee 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).

integer

Example

42

Created address

Media typeapplication/json
object
data
required
object
id
required
integer
first_name
required
string
nullable
last_name
required
string
nullable
phone
required
string
nullable
phone_country
required
string
nullable
email
required
string
nullable
address1
required
string
nullable
address2
required
string
nullable
type
required

Address kind: OFFICE, HOME, PO_BOX or EXTERNAL_STORAGE

string
nullable
zip
required
string
nullable
city
required
string
nullable
state
required

Legacy free-text state, no longer written: read administrative_area instead.

string
nullable
administrative_area
required

Local subdivision code

string
nullable
administrative_area_iso
required

ISO 3166-2 subdivision code

string
nullable
country
required

ISO 3166-1 alpha-2 country code

string
nullable
label
required
string
nullable
comment
required
string
nullable
is_default
required
boolean
is_hq
required
boolean
user_id
required

Employee who lives at this HOME address; null for other addresses

integer
nullable
created_at
required
string
nullable
updated_at
required
string
nullable

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

Media typeapplication/json
Any of:
object
message
required

Every validation failure, comma-separated

string
type
required
string
Allowed values: validation_error
error
required
string
Allowed values: validation_error

Example

{
"message": "Required, must be an ISO 3166-1 alpha-2 country code",
"type": "validation_error",
"error": "validation_error"
}

Missing, invalid, or revoked API key

Media typetext/plain
string

Example

Unauthorized

The API key has READ scope; this operation needs WRITE

Media typeapplication/json
object
error
required
string
Allowed values: INSUFFICIENT_SCOPE

Example

{
"error": "INSUFFICIENT_SCOPE"
}

Resource not found; USER_NOT_FOUND when user_id is not an active user of the company

Media typeapplication/json
object
error
required
string
Allowed values: COMPANY_NOT_FOUND DELIVERY_COUNTRY_NOT_FOUND USER_NOT_FOUND

Example

{
"error": "COMPANY_NOT_FOUND"
}

Rate limit exceeded. The RateLimit-* headers give the limit and the reset time.

Media typetext/plain
string

Example

Too many requests, please try again later.

Unexpected server error

Media typeapplication/json
object
error
required
string
Allowed values: INTERNAL_ERROR

Example

{
"error": "INTERNAL_ERROR"
}

Rate limiting is temporarily unavailable; retry with backoff

Media typeapplication/json
object
message
required
string

Example generated

{
"message": "example"
}