Organization API

https://api.gandi.net/v5/organization

Gandi Organization API

Introduction

This section of our documentation explains how to view information on organizations at Gandi.net through our REST API. Organizations are used to share products via user accounts.

The Organization API is a read-only API. All organization management must be performed via our web interface:
https://admin.gandi.net/organizations/

General information on using organizations at Gandi can be found in our public documentation at:
https://docs.gandi.net/en/sharing_products/index.html

Organization Management

https://api.gandi.net/v5/organization/organizations

get List organizations

This route returns a list of organizations the authenticated user has permission to access.

Request

Query String
  • Optional
    • ~namestring
      Filters the list by a name pattern.
      Example: *lice
      Example: alic*
    • namestring
      Filters the list by exact name.
    • permissionstring
      Filters the list by the permission the authenticated user has on that organization and products in it.
    • sort_bystring

      One of: "name", "type", "id"

      Default: "name"

      Used to specify how you want the results sorted.
    • typestring

      One of: "individual", "company", "association", "publicbody"

      Filters the list by type of organization.
Headers
  • Required
    • Authorizationstring
      The Authorization header must start with Apikey, followed by the user's API Key.
      Example: Apikey your-api-key

Responses

200

Body
  • application/json
    array

    Of items of type:

    • object

      With the following properties:

      • idstring
        The main identifier of the organization. Also known as sharing_id in many routes.
      • namestring
        Unique name of the organization.
      Optional
      • corporateboolean
        Flag to indicate the corporate status for the organization.
      • emailstring
        The email address of the organization.
      • firstnamestring
        The first name of the organization.
      • lastnamestring
        The last name of the organization.
      • orgnamestring
        The company, association, or public body name of the (non-individual) organization.
      • resellerboolean
        Flag to indicate the reseller status for the organization.
      • sirenstring
        The siren number of the (non-individual) organization.
      • typestring
        The type of the organization.
      • vat_numberstring
        The VAT number of the (non-individual) organization.
    Example:
    [
      {
        "name": "alice",
        "firstname": "Alice",
        "lastname": "Doe",
        "id": "80548b45-e18d-4cab-adef-e10a8406de4a",
        "reseller": false,
        "corporate": true,
        "type": "individual",
        "email": "alice@example.net"
      },
      {
        "name": "bob",
        "firstname": "Bob",
        "orgname": "Bob's Roads",
        "lastname": "Doe",
        "email": "bob@example.net",
        "reseller": false,
        "corporate": false,
        "type": "publicbody",
        "id": "e1ab1204-e638-4fd8-85a4-34dd95013cdc"
      },
      {
        "name": "ron",
        "firstname": "Ron",
        "orgname": "Ron Inc.",
        "lastname": "Doe",
        "email": "ron@example.net",
        "reseller": false,
        "corporate": false,
        "type": "company",
        "id": "b018061c-a4e3-4d6d-8445-e3837bd23815"
      }
    ]

403

Access to the resource is denied. Mainly due to a lack of permissions to access it.
Body
  • application/json
    object

    With the following properties:

    • causestring
    • codeinteger
    • messagestring
    • objectstring

401

Bad authentication attempt because of a wrong API Key.
Body
  • application/json
    object

    With the following properties:

    • causestring
    • codeinteger
    • messagestring
    • objectstring

Secured by

Authentication with API Key

This authentication scheme allows you to pass your Gandi API Key and be granted access to your resources, as your permissions allow.
Headers
  • Required
    • Authorizationstring
      The Authorization header must start with Apikey, followed by the user's API Key.
      Example: Apikey your-api-key

Management Of Customers Under A Reseller Organization

https://api.gandi.net/v5/organization/organizations/{id}/customers

When an organization is flagged reseller, then the product is not legally owned by the organization, but by the organization's customers.

get List customers

This route returns the list of customers of the given reseller organization.

Request

URI Parameters
    • idstring
      Organisation ID.
Query String
  • Optional
    • namestring
      Filters the list by name, with optional patterns.
      Example: *lice
      Example: alic*
    • permissionstring
      Filters the list by the permission the authenticated user has on that organization and products in it.
    • sort_bystring

      One of: "name", "type", "id"

      Default: "name"

      Used to specify how you want the results sorted.
Headers
  • Required
    • Authorizationstring
      The Authorization header must start with Apikey, followed by the user's API Key.
      Example: Apikey your-api-key

Responses

200

Body
  • application/json
    array

    Of items of type:

    • object

      With the following properties:

      • emailstring
        Email of the customer.
      • firstnamestring
        First name of the customer.
      • idstring
        The main identifier of the customer. Also known as sharing_id in many routes.
      • lastnamestring
        Last name of the customer.
      • namestring
        Name of the customer.
      • typestring

        One of: "individual", "company", "association", "publicbody"

        Type of the customer organization.
      Optional
      • orgnamestring
        Organization legal name of the customer.
    Example:
    [
      {
        "id": "80548b45-e18d-4cab-adef-e10a8406de4a",
        "name": "alice",
        "firstname": "Alice",
        "lastname": "Doe",
        "type": "individual",
        "email": "alice@example.net"
      },
      {
        "id": "e1ab1204-e638-4fd8-85a4-34dd95013cdc",
        "name": "bob",
        "firstname": "Bob",
        "lastname": "Doe",
        "type": "publicbody",
        "orgname": "Bob's Roads",
        "email": "bob@example.net"
      },
      {
        "id": "b018061c-a4e3-4d6d-8445-e3837bd23815",
        "name": "ron",
        "firstname": "Ron",
        "lastname": "Doe",
        "type": "company",
        "orgname": "Ron Inc.",
        "email": "ron@example.net"
      }
    ]

403

Access to the resource is denied. Mainly due to a lack of permissions to access it.
Body
  • application/json
    object

    With the following properties:

    • causestring
    • codeinteger
    • messagestring
    • objectstring

401

Bad authentication attempt because of a wrong API Key.
Body
  • application/json
    object

    With the following properties:

    • causestring
    • codeinteger
    • messagestring
    • objectstring

Secured by

Authentication with API Key

This authentication scheme allows you to pass your Gandi API Key and be granted access to your resources, as your permissions allow.
Headers
  • Required
    • Authorizationstring
      The Authorization header must start with Apikey, followed by the user's API Key.
      Example: Apikey your-api-key

post Create a new customer

This route is used to create a new customer.

Request

URI Parameters
    • idstring
      Organisation ID.
Headers
  • Required
    • Authorizationstring
      The Authorization header must start with Apikey, followed by the user's API Key.
      Example: Apikey your-api-key
Body
  • application/json
    object

    With the following properties:

    Required
    • citystring
    • countrystring
      Country code.
    • emailstring
    • firstnamestring
      First name.
    • lastnamestring
      Last name.
    • phonestring
    • streetaddrstring
      Street address.
    • typestring

      One of: "individual", "company", "association", "publicbody"

      Type of the customer organization.
    Optional
    • faxstring
    • orgnamestring
      Organization legal name.
    • referencestring
      Optional text to display on the invoice, such as your own customer reference info.
    • statestring
      State/Province/Region.
    • streetaddr2string
      Apt. number, suite, building, etc.
    • zipstring
    Example:
    {
      "type": "company",
      "firstname": "John",
      "lastname": "Do",
      "orgname": "R&D",
      "email": "jd@example.net",
      "streetaddr": "21 jump street",
      "streetaddr2": "Appt31",
      "zip": "17137",
      "city": "Nieul-sur-mer",
      "country": "FR",
      "state": "FR-T",
      "phone": "+33.612345678",
      "fax": "+33.612345699",
      "reference": "abc/3458"
    }

Responses

202

Headers
  • Optional
    • Locationstring
Body
  • application/json
    object

    With the following properties:

    • messagestring
      Confirmation message.

403

Access to the resource is denied. Mainly due to a lack of permissions to access it.
Body
  • application/json
    object

    With the following properties:

    • causestring
    • codeinteger
    • messagestring
    • objectstring

401

Bad authentication attempt because of a wrong API Key.
Body
  • application/json
    object

    With the following properties:

    • causestring
    • codeinteger
    • messagestring
    • objectstring

Secured by

Authentication with API Key

This authentication scheme allows you to pass your Gandi API Key and be granted access to your resources, as your permissions allow.
Headers
  • Required
    • Authorizationstring
      The Authorization header must start with Apikey, followed by the user's API Key.
      Example: Apikey your-api-key

Authenticated User Information

https://api.gandi.net/v5/organization/user-info

get Get user information

This route returns information on the current authenticated user.

Request

Headers
  • Required
    • Authorizationstring
      The Authorization header must start with Apikey, followed by the user's API Key.
      Example: Apikey your-api-key

Responses

200

Body
  • application/json
    object

    With the following properties:

    • citystring
      the city name of the address.
    • emailstring
      the email address of the user.
    • idstring
      the sharing id of the user.
    • langstring
      language used by the user.
    • namestring
      the sharing name of the user.
    • usernamestring
      the username of the user.
    Optional
    • countrystring
      country ISO code of the address.
    • faxstring
      fax number.
    • firstnamestring
      the first name of the user.
    • lastnamestring
      the last name of the user.
    • phonestring
      phone number.
    • statestring
      state ISO code of the address.
    • streetaddrstring
      the street address of the user.
    • streetaddr2string
      additional street address info of the user.
    • zipstring
      zip code of the address.
    Example:
    {
      "username": "alice",
      "city": "Paris",
      "streetaddr": "5 rue neuve",
      "zip": "75001",
      "name": "alice",
      "firstname": "Alice",
      "lastname": "Doe",
      "id": "ebfcd3cd-e014-4a3d-8216-6e342f227c3d",
      "phone": "+33.123456789",
      "state": "FR-J",
      "country": "FR",
      "email": "alice@example.org",
      "lang": "en"
    }

403

Access to the resource is denied. Mainly due to a lack of permissions to access it.
Body
  • application/json
    object

    With the following properties:

    • causestring
    • codeinteger
    • messagestring
    • objectstring

401

Bad authentication attempt because of a wrong API Key.
Body
  • application/json
    object

    With the following properties:

    • causestring
    • codeinteger
    • messagestring
    • objectstring

Secured by

Authentication with API Key

This authentication scheme allows you to pass your Gandi API Key and be granted access to your resources, as your permissions allow.
Headers
  • Required
    • Authorizationstring
      The Authorization header must start with Apikey, followed by the user's API Key.
      Example: Apikey your-api-key