The User Address resource
Validated user addresses are required in order to create a subscription.
Properties
- Name
object
- Type
- string
- Description
Type of object is always
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
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
- Name
createdAt
- Type
- string
- Description
The time the address was created.
Example:2021-01-21T19:38:34Z
Response
{
"object": "userAddress",
"id": "adr_0SNlurA049MEWV5ELDmnaqVXgTFT",
"city": "New York City",
"country": "US",
"line1": "129 West 81st Street",
"line2": "Apartment 5A",
"postalCode": "10024",
"state": "NY",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d",
"createdAt": "2021-01-21T19:38:34Z"
}
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
Response Schemas
- Name
object
- Type
- string
- Description
Type of object is always
list
.
required- Name
items
- Type
- array
- Description
- List of objects of type `userAddress`.
required- 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.
required- 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.
required
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",
"line1": "129 West 81st Street",
"line2": "Apartment 5A",
"postalCode": "10024",
"state": "NY",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d",
"createdAt": "2021-01-21T19:38:34Z"
}
],
"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
Response Schemas
- Name
object
- Type
- string
- Description
Type of object is always
userAddress
.
required- Name
id
- Type
- string
- Description
Unique identifier for the address.
Example:adr_0SNlurA049MEWV5ELDmnaqVXgTFT
required- 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
required- Name
postalCode
- Type
- nullable string
- Description
The postal code of the address.
Example:10024
required- Name
state
- Type
- nullable string
- Description
The state/province/region of the address.
Example:NY
required- Name
user
- Type
- string
- Description
Unique identifier for the address user.
Example:usr_0SNlurA049MEWV4OpCwsNyC9Kn2d
required- Name
createdAt
- Type
- string
- Description
The time the address was created.
Example:2021-01-21T19:38:34Z
required
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",
"line1": "129 West 81st Street",
"line2": "Apartment 5A",
"postalCode": "10024",
"state": "NY",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d",
"createdAt": "2021-01-21T19:38:34Z"
}
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
Response Schemas
- Name
object
- Type
- string
- Description
Type of object is always
userAddress
.
required- Name
id
- Type
- string
- Description
Unique identifier for the address.
Example:adr_0SNlurA049MEWV5ELDmnaqVXgTFT
required- 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
required- Name
postalCode
- Type
- nullable string
- Description
The postal code of the address.
Example:10024
required- Name
state
- Type
- nullable string
- Description
The state/province/region of the address.
Example:NY
required- Name
user
- Type
- string
- Description
Unique identifier for the address user.
Example:usr_0SNlurA049MEWV4OpCwsNyC9Kn2d
required- Name
createdAt
- Type
- string
- Description
The time the address was created.
Example:2021-01-21T19:38:34Z
required
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",
"line1": "129 West 81st Street",
"line2": "Apartment 5A",
"postalCode": "10024",
"state": "NY",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d",
"createdAt": "2021-01-21T19:38:34Z"
}
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
Response Schemas
- Name
object
- Type
- string
- Description
Type of object is always
userAddress
.
required- Name
id
- Type
- string
- Description
Unique identifier for the address.
Example:adr_0SNlurA049MEWV5ELDmnaqVXgTFT
required- 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
required- Name
postalCode
- Type
- nullable string
- Description
The postal code of the address.
Example:10024
required- Name
state
- Type
- nullable string
- Description
The state/province/region of the address.
Example:NY
required- Name
user
- Type
- string
- Description
Unique identifier for the address user.
Example:usr_0SNlurA049MEWV4OpCwsNyC9Kn2d
required- Name
createdAt
- Type
- string
- Description
The time the address was created.
Example:2021-01-21T19:38:34Z
required
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",
"line1": "129 West 81st Street",
"line2": "Apartment 5A",
"postalCode": "10024",
"state": "NY",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d",
"createdAt": "2021-01-21T19:38:34Z"
}