User Addresses

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"
}

GET/projects/{project}/users/{user}/addresses

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
    required
    Description

    The unique identifier for the project.

    Example: gigs
  • Name
    user
    Type
    string
    required
    Description

    The unique identifier for the user.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d

Response Schemas

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always list.

  • Name
    items
    Type
    array
    required
    Description
    List of objects of type `userAddress`.
  • Name
    moreItemsAfter
    Type
    nullable string
    required
    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
    required
    Description

    A unique identifier to be used as before pagination parameter if more items are available sorted before the current batch of items.

Request

GET
/projects/{project}/users/{user}/addresses
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
}

POST/projects/{project}/users/{user}/addresses

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
    required
    Description

    The city/municipality of the address.

    Example: New York City
  • Name
    country
    Type
    string
    required
    Description

    The ISO 3166-1 alpha-2 country code of the address.

    Example: US
  • Name
    line1
    Type
    string
    required
    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
    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
    required
    Description

    The unique identifier for the project.

    Example: gigs
  • Name
    user
    Type
    string
    required
    Description

    The unique identifier for the user.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d

Response Schemas

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always userAddress.

  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the address.

    Example: adr_0SNlurA049MEWV5ELDmnaqVXgTFT
  • Name
    city
    Type
    string
    required
    Description

    The city/municipality of the address.

    Example: New York City
  • Name
    country
    Type
    string
    required
    Description

    The ISO 3166-1 alpha-2 country code of the address.

    Example: US
  • Name
    line1
    Type
    string
    required
    Description

    The first line of the address, e.g. street and house number.

    Example: 129 West 81st Street
  • Name
    line2
    Type
    nullable string
    required
    Description

    The second line of the address, e.g. apartment number.

    Example: Apartment 5A
  • Name
    postalCode
    Type
    nullable string
    required
    Description

    The postal code of the address.

    Example: 10024
  • Name
    state
    Type
    nullable string
    required
    Description

    The state/province/region of the address.

    Example: NY
  • Name
    user
    Type
    string
    required
    Description

    Unique identifier for the address user.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d
  • Name
    createdAt
    Type
    string
    required
    Description

    The time the address was created.

    Example: 2021-01-21T19:38:34Z

Request

POST
/projects/{project}/users/{user}/addresses
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"
}

GET/projects/{project}/users/{user}/addresses/{address}

Retrieve a user address

Retrieves the details of an existing address for a given user.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: gigs
  • Name
    user
    Type
    string
    required
    Description

    The unique identifier for the user.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d
  • Name
    address
    Type
    string
    required
    Description

    The unique identifier for the address.

    Example: adr_0SNlurA049MEWV5ELDmnaqVXgTFT

Response Schemas

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always userAddress.

  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the address.

    Example: adr_0SNlurA049MEWV5ELDmnaqVXgTFT
  • Name
    city
    Type
    string
    required
    Description

    The city/municipality of the address.

    Example: New York City
  • Name
    country
    Type
    string
    required
    Description

    The ISO 3166-1 alpha-2 country code of the address.

    Example: US
  • Name
    line1
    Type
    string
    required
    Description

    The first line of the address, e.g. street and house number.

    Example: 129 West 81st Street
  • Name
    line2
    Type
    nullable string
    required
    Description

    The second line of the address, e.g. apartment number.

    Example: Apartment 5A
  • Name
    postalCode
    Type
    nullable string
    required
    Description

    The postal code of the address.

    Example: 10024
  • Name
    state
    Type
    nullable string
    required
    Description

    The state/province/region of the address.

    Example: NY
  • Name
    user
    Type
    string
    required
    Description

    Unique identifier for the address user.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d
  • Name
    createdAt
    Type
    string
    required
    Description

    The time the address was created.

    Example: 2021-01-21T19:38:34Z

Request

GET
/projects/{project}/users/{user}/addresses/{address}
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/projects/{project}/users/{user}/addresses/{address}

Delete a user address

Retrieves the details of an existing user address and deletes it.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: gigs
  • Name
    user
    Type
    string
    required
    Description

    The unique identifier for the user.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d
  • Name
    address
    Type
    string
    required
    Description

    The unique identifier for the address.

    Example: adr_0SNlurA049MEWV5ELDmnaqVXgTFT

Response Schemas

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always userAddress.

  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the address.

    Example: adr_0SNlurA049MEWV5ELDmnaqVXgTFT
  • Name
    city
    Type
    string
    required
    Description

    The city/municipality of the address.

    Example: New York City
  • Name
    country
    Type
    string
    required
    Description

    The ISO 3166-1 alpha-2 country code of the address.

    Example: US
  • Name
    line1
    Type
    string
    required
    Description

    The first line of the address, e.g. street and house number.

    Example: 129 West 81st Street
  • Name
    line2
    Type
    nullable string
    required
    Description

    The second line of the address, e.g. apartment number.

    Example: Apartment 5A
  • Name
    postalCode
    Type
    nullable string
    required
    Description

    The postal code of the address.

    Example: 10024
  • Name
    state
    Type
    nullable string
    required
    Description

    The state/province/region of the address.

    Example: NY
  • Name
    user
    Type
    string
    required
    Description

    Unique identifier for the address user.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d
  • Name
    createdAt
    Type
    string
    required
    Description

    The time the address was created.

    Example: 2021-01-21T19:38:34Z

Request

DELETE
/projects/{project}/users/{user}/addresses/{address}
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"
}