User Addresses
Properties
- Name
- object
- Type
- string
- Description
Type of object is always
userAddress
.Allowed values:userAddress
- Name
- id
- Type
- string
- Description
Unique identifier for the address.
Example:"adr_0SNlurA049MEWV5ELDmnaqVXgTFT"
- Name
- city
- Type
- string
- Description
The city/municipality of the address.
Example:"New York City"
- Name
- country
- Type
- string
- Description
The ISO 3166-1 alpha-2 country code of the address.
Example:"US"
- Name
- createdAt
- Type
- string
- Description
The time the address was created.
Example:"2021-01-21T19:38:34Z"
- Name
- line1
- Type
- string
- Description
The first line of the address, e.g. street and house number.
Example:"129 West 81st Street"
- Name
- line2
- Type
- nullable string
- Description
The second line of the address, e.g. apartment number.
Example:"Apartment 5A"
- Name
- postalCode
- Type
- nullable string
- Description
The postal code of the address.
Example:"10024"
- Name
- state
- Type
- nullable string
- Description
The state/province/region of the address.
Example:"NY"
- Name
- user
- Type
- string
- Description
Unique identifier for the address user.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
Example
{
"object": "userAddress",
"id": "adr_0SNlurA049MEWV5ELDmnaqVXgTFT",
"city": "New York City",
"country": "US",
"createdAt": "2021-01-21T19:38:34.0Z",
"line1": "129 West 81st Street",
"line2": "Apartment 5A",
"postalCode": "10024",
"state": "NY",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}
List all user addresses
Returns a list of addresses owned by the given user. The addresses returned are sorted by creation date, with the most recently created addresses appearing first.
Path Parameters
- Name
- project
- Type
- string
- Description
The unique identifier for the project.
Example:"gigs"
required- Name
- user
- Type
- string
- Description
The unique identifier for the user.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
required
Responses
Returns a list of address objects.
- Name
- object
- Type
- string
- Description
Type of object is always
list
.Allowed values:list
- Name
- items
- Type
- array
- Description
- List of objects of type `userAddress`.
- Name
- moreItemsAfter
- Type
- nullable string
- Description
A unique identifier to be used as
after
pagination parameter if more items are available sorted after the current batch of items.
- Name
- moreItemsBefore
- Type
- nullable string
- Description
A unique identifier to be used as
before
pagination parameter if more items are available sorted before the current batch of items.
Request
curl https://api.gigs.com/projects/{project}/users/{user}/addresses \
-X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
Response
{
"object": "list",
"items": [
{
"object": "userAddress",
"id": "adr_0SNlurA049MEWV5ELDmnaqVXgTFT",
"city": "New York City",
"country": "US",
"createdAt": "2021-01-21T19:38:34Z",
"line1": "129 West 81st Street",
"line2": "Apartment 5A",
"postalCode": "10024",
"state": "NY",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}
],
"moreItemsAfter": null,
"moreItemsBefore": null
}
Create a user address
Create a new address for the given user with the provided parameters.
If any validations fail during the user address creation process, detailed information will be provided in the error response body. If applicable, suggested alternative values for properties that do not pass the validations will also be included.
Body
- Name
- city
- Type
- string
- Description
The city/municipality of the address.
Example:"New York City"
required- Name
- country
- Type
- string
- Description
The ISO 3166-1 alpha-2 country code of the address.
Example:"US"
required- Name
- line1
- Type
- string
- Description
The first line of the address, e.g. street and house number.
Example:"129 West 81st Street"
required- Name
- line2
- Type
- nullable string
- Description
The second line of the address, e.g. apartment number.
Example:"Apartment 5A"
- Name
- state
- Type
- nullable string
- Description
The state/province/region of the address. Required for US/CA addresses to be a valid ISO 3166-2 2 letter code.
Example:"NY"
- Name
- postalCode
- Type
- nullable string
- Description
The postal code of the address. Required for countries with postal codes.
Example:"10024"
Path Parameters
- Name
- project
- Type
- string
- Description
The unique identifier for the project.
Example:"gigs"
required- Name
- user
- Type
- string
- Description
The unique identifier for the user.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
required
Responses
Returns the created address.
- Name
- object
- Type
- string
- Description
Type of object is always
userAddress
.Allowed values:userAddress
- Name
- id
- Type
- string
- Description
Unique identifier for the address.
Example:"adr_0SNlurA049MEWV5ELDmnaqVXgTFT"
- Name
- city
- Type
- string
- Description
The city/municipality of the address.
Example:"New York City"
- Name
- country
- Type
- string
- Description
The ISO 3166-1 alpha-2 country code of the address.
Example:"US"
- Name
- createdAt
- Type
- string
- Description
The time the address was created.
Example:"2021-01-21T19:38:34Z"
- Name
- line1
- Type
- string
- Description
The first line of the address, e.g. street and house number.
Example:"129 West 81st Street"
- Name
- line2
- Type
- nullable string
- Description
The second line of the address, e.g. apartment number.
Example:"Apartment 5A"
- Name
- postalCode
- Type
- nullable string
- Description
The postal code of the address.
Example:"10024"
- Name
- state
- Type
- nullable string
- Description
The state/province/region of the address.
Example:"NY"
- Name
- user
- Type
- string
- Description
Unique identifier for the address user.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
Request
curl https://api.gigs.com/projects/{project}/users/{user}/addresses \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-d "{\"city\":\"New York City\",\"country\":\"US\",\"line1\":\"129 West 81st Street\",\"line2\":\"Apartment 5A\",\"state\":\"NY\",\"postalCode\":\"10024\"}"
Response
{
"object": "userAddress",
"id": "adr_0SNlurA049MEWV5ELDmnaqVXgTFT",
"city": "New York City",
"country": "US",
"createdAt": "2021-01-21T19:38:34Z",
"line1": "129 West 81st Street",
"line2": "Apartment 5A",
"postalCode": "10024",
"state": "NY",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}
Retrieve a user address
Retrieves the details of an existing address for a given user.
Path Parameters
- Name
- project
- Type
- string
- Description
The unique identifier for the project.
Example:"gigs"
required- Name
- user
- Type
- string
- Description
The unique identifier for the user.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
required- Name
- address
- Type
- string
- Description
The unique identifier for the address.
Example:"adr_0SNlurA049MEWV5ELDmnaqVXgTFT"
required
Responses
Returns the address if it exists and is owned by the user.
- Name
- object
- Type
- string
- Description
Type of object is always
userAddress
.Allowed values:userAddress
- Name
- id
- Type
- string
- Description
Unique identifier for the address.
Example:"adr_0SNlurA049MEWV5ELDmnaqVXgTFT"
- Name
- city
- Type
- string
- Description
The city/municipality of the address.
Example:"New York City"
- Name
- country
- Type
- string
- Description
The ISO 3166-1 alpha-2 country code of the address.
Example:"US"
- Name
- createdAt
- Type
- string
- Description
The time the address was created.
Example:"2021-01-21T19:38:34Z"
- Name
- line1
- Type
- string
- Description
The first line of the address, e.g. street and house number.
Example:"129 West 81st Street"
- Name
- line2
- Type
- nullable string
- Description
The second line of the address, e.g. apartment number.
Example:"Apartment 5A"
- Name
- postalCode
- Type
- nullable string
- Description
The postal code of the address.
Example:"10024"
- Name
- state
- Type
- nullable string
- Description
The state/province/region of the address.
Example:"NY"
- Name
- user
- Type
- string
- Description
Unique identifier for the address user.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
Request
curl https://api.gigs.com/projects/{project}/users/{user}/addresses/{address} \
-X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
Response
{
"object": "userAddress",
"id": "adr_0SNlurA049MEWV5ELDmnaqVXgTFT",
"city": "New York City",
"country": "US",
"createdAt": "2021-01-21T19:38:34Z",
"line1": "129 West 81st Street",
"line2": "Apartment 5A",
"postalCode": "10024",
"state": "NY",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}
Delete a user address
Retrieves the details of an existing user address and deletes it.
Path Parameters
- Name
- project
- Type
- string
- Description
The unique identifier for the project.
Example:"gigs"
required- Name
- user
- Type
- string
- Description
The unique identifier for the user.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
required- Name
- address
- Type
- string
- Description
The unique identifier for the address.
Example:"adr_0SNlurA049MEWV5ELDmnaqVXgTFT"
required
Responses
Returns the address after a successful deletion.
- Name
- object
- Type
- string
- Description
Type of object is always
userAddress
.Allowed values:userAddress
- Name
- id
- Type
- string
- Description
Unique identifier for the address.
Example:"adr_0SNlurA049MEWV5ELDmnaqVXgTFT"
- Name
- city
- Type
- string
- Description
The city/municipality of the address.
Example:"New York City"
- Name
- country
- Type
- string
- Description
The ISO 3166-1 alpha-2 country code of the address.
Example:"US"
- Name
- createdAt
- Type
- string
- Description
The time the address was created.
Example:"2021-01-21T19:38:34Z"
- Name
- line1
- Type
- string
- Description
The first line of the address, e.g. street and house number.
Example:"129 West 81st Street"
- Name
- line2
- Type
- nullable string
- Description
The second line of the address, e.g. apartment number.
Example:"Apartment 5A"
- Name
- postalCode
- Type
- nullable string
- Description
The postal code of the address.
Example:"10024"
- Name
- state
- Type
- nullable string
- Description
The state/province/region of the address.
Example:"NY"
- Name
- user
- Type
- string
- Description
Unique identifier for the address user.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
Request
curl https://api.gigs.com/projects/{project}/users/{user}/addresses/{address} \
-X DELETE \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
Response
{
"object": "userAddress",
"id": "adr_0SNlurA049MEWV5ELDmnaqVXgTFT",
"city": "New York City",
"country": "US",
"createdAt": "2021-01-21T19:38:34Z",
"line1": "129 West 81st Street",
"line2": "Apartment 5A",
"postalCode": "10024",
"state": "NY",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}