Examples

POST /api/v2/watchlists
{
  "data": {
    "type": "watchlists",
    "attributes": {
      "name": "My Portfolio"
    },
    "relationships": {
      "account": {
        "data": {
          "type": "accounts",
          "id": "20"
        }
      },
      "entities": {
        "data": [
          {
            "type": "entities",
            "id": "1"
          }
        ]
      }
    }
  }
}
201
{
  "data": {
    "id": "21",
    "type": "watchlists",
    "links": {
      "self": "http://test.host/api/v2/watchlists/21"
    },
    "attributes": {
      "name": "My Portfolio"
    },
    "relationships": {
      "account": {
        "links": {
          "self": "http://test.host/api/v2/watchlists/21/relationships/account",
          "related": "http://test.host/api/v2/watchlists/21/account"
        }
      },
      "entities": {
        "links": {
          "self": "http://test.host/api/v2/watchlists/21/relationships/entities",
          "related": "http://test.host/api/v2/watchlists/21/entities"
        }
      }
    }
  }
}

Params

Param name Description
data
required

watchlist information

Validations:

  • Must be a Hash

data[type]
required

Validations:

data[relationships]
required

Validations:

  • Must be a Hash

data[relationships][account]
required

Validations:

  • Must be a Hash

data[relationships][account][data]
required

Validations:

  • Must be a Hash

data[relationships][account][data][type]
required

Account type, which is `accounts`

Validations:

  • Must be a String

data[relationships][account][data][id]
required

Account ID

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hyphen(-) with no leading or trailing space.

data[relationships][watchable]
required

Validations:

  • Must be a Hash

data[relationships][watchable][data]
required

Validations:

  • Must be a Hash

data[relationships][watchable][data][type]
required

Watchable type, which can either be `entities`, `insights`, or `accounts`

Validations:

  • Must be a String

data[relationships][watchable][data][id]
required

Watchable ID

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hyphen(-) with no leading or trailing space.