API documentation

Genders

Overview

The Gender object represents a gender associated to a contact. A contact must have a gender before being created.

List all the genders in the account

GET /genders

Response

{
  "data": [
    {
      "id": 1,
      "object": "gender",
      "name": "Man",
      "account": {
        "id": 1
      },
      "created_at": "2019-01-04T23:37:42Z",
      "updated_at": "2019-01-04T23:37:42Z"
    },
    {
      "id": 2,
      "object": "gender",
      "name": "Woman",
      "account": {
        "id": 1
      },
      "created_at": "2019-01-04T23:37:42Z",
      "updated_at": "2019-01-04T23:37:42Z"
    },
    {
      "id": 3,
      "object": "gender",
      "name": "Rather not say",
      "account": {
        "id": 1
      },
      "created_at": "2019-01-04T23:37:42Z",
      "updated_at": "2019-01-04T23:37:42Z"
    }
  ],
  "links": {
    "first": "https:\/\/app.monicahq.com\/api\/genders?page=1",
    "last": "https:\/\/app.monicahq.com\/api\/genders?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "path": "https:\/\/app.monicahq.com\/api\/genders",
    "per_page": 15,
    "to": 3,
    "total": 3
  }
}

Get a specific gender

GET /genders/:id

Response

{
  "data": {
    "id": 1,
    "object": "gender",
    "name": "Man",
    "account": {
      "id": 1
    },
    "created_at": "2019-01-04T23:37:42Z",
    "updated_at": "2019-01-04T23:37:42Z"
  }
}

Create a gender

POST /genders/

Input

Name Type Description
name string Required. The description of the gender. Max 255 characters.

Example

{
  "name":"man"
}

Response

The API returns a gender object if the gender succeeds.

{
  "data": {
    "id": 7,
    "object": "gender",
    "name": "man",
    "account": {
      "id": 1
    },
    "created_at": "2019-01-04T23:45:23Z",
    "updated_at": "2019-01-04T23:45:23Z"
  }
}

Update a gender

PUT /genders/:id

Input

Name Type Description
name string Required. The description of the gender. Max 255 characters.

Example

{
    "name":"woman"
}

Response

{
  "data": {
    "id": 7,
    "object": "gender",
    "name": "woman",
    "account": {
      "id": 1
    },
    "created_at": "2019-01-04T23:45:23Z",
    "updated_at": "2019-01-04T23:46:22Z"
  }
}

Delete a gender

Warning: deleting a gender is dangerous. You have to make sure that no contacts in your account have this gender before deleting it.

DELETE /genders/:id

Response

The response sends back the id that was just deleted.

{
  "deleted": true,
  "id": 31
}

Company

Resources

© 2018

Proudly Canadian