Authentication is required.


GET /api/v2/watchlists
List logged-in account's watchlist

Examples

GET /api/v2/watchlists
200
{
  "data": [
    {
      "id": "18",
      "type": "watchlists",
      "links": {
        "self": "http://test.host/api/v2/watchlists/18"
      },
      "attributes": {
        "name": "My Portfolio"
      },
      "relationships": {
        "account": {
          "links": {
            "self": "http://test.host/api/v2/watchlists/18/relationships/account",
            "related": "http://test.host/api/v2/watchlists/18/account"
          }
        },
        "entities": {
          "links": {
            "self": "http://test.host/api/v2/watchlists/18/relationships/entities",
            "related": "http://test.host/api/v2/watchlists/18/entities"
          }
        }
      }
    }
  ],
  "meta": {
    "record-count": 1
  }
}

GET /api/v2/watchlists/:id
Show a watchlist

Examples

GET /api/v2/watchlists/128
200
{
  "data": {
    "id": "128",
    "type": "watchlists",
    "links": {
      "self": "http://test.host/api/v2/watchlists/128"
    },
    "attributes": {
      "name": "My Portfolio"
    },
    "relationships": {
      "account": {
        "links": {
          "self": "http://test.host/api/v2/watchlists/128/relationships/account",
          "related": "http://test.host/api/v2/watchlists/128/account"
        }
      },
      "entities": {
        "links": {
          "self": "http://test.host/api/v2/watchlists/128/relationships/entities",
          "related": "http://test.host/api/v2/watchlists/128/entities"
        }
      }
    }
  }
}

Params

Param name Description
id
required

watchlist 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.


POST /api/v2/watchlists
Create logged-in account's watchlist

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.


PATCH /apiv2/watchlists/:id
Update a watchlist

Examples

PATCH /api/v2/watchlists/33
{
  "data": {
    "id": "33",
    "type": "watchlists",
    "attributes": {
      "name": "a new name"
    },
    "relationships": {
      "account": {
        "data": {
          "type": "accounts",
          "id": "26"
        }
      }
    }
  }
}
200
{
  "data": {
    "id": "33",
    "type": "watchlists",
    "links": {
      "self": "http://test.host/api/v2/watchlists/33"
    },
    "attributes": {
      "name": "a new name"
    },
    "relationships": {
      "account": {
        "links": {
          "self": "http://test.host/api/v2/watchlists/33/relationships/account",
          "related": "http://test.host/api/v2/watchlists/33/account"
        }
      },
      "entities": {
        "links": {
          "self": "http://test.host/api/v2/watchlists/33/relationships/entities",
          "related": "http://test.host/api/v2/watchlists/33/entities"
        }
      }
    }
  }
}

Params

Param name Description
id
required

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

watchlist information

Validations:

  • Must be a Hash

data[type]
optional

Validations:

data[relationships]
optional

Validations:

  • Must be a Hash

data[relationships][account]
optional

Validations:

  • Must be a Hash

data[relationships][account][data]
optional

Validations:

  • Must be a Hash

data[relationships][account][data][type]
optional

Account type, which is `accounts`

Validations:

  • Must be a String

data[relationships][account][data][id]
optional

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]
optional

Validations:

  • Must be a Hash

data[relationships][watchable][data]
optional

Validations:

  • Must be a Hash

data[relationships][watchable][data][type]
optional

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

Validations:

  • Must be a String

data[relationships][watchable][data][id]
optional

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.


PATCH /apiv2/watchlists/:id/add_entities
Add entities to the watchlist

Examples

PATCH /api/v2/watchlists/88/add_entities
{
  "data": {
    "id": "88",
    "type": "watchlists",
    "attributes": {
      "name": "My Portfolio"
    },
    "relationships": {
      "entities": {
        "data": [
          {
            "type": "entities",
            "id": "70"
          },
          {
            "type": "entities",
            "id": "72"
          }
        ]
      }
    }
  }
}
200
{
  "data": {
    "id": "88",
    "type": "watchlists",
    "links": {
      "self": "/api/v2/watchlists/88"
    },
    "attributes": {
      "name": "My Portfolio"
    },
    "relationships": {
      "account": {
        "links": {
          "self": "/api/v2/watchlists/88/relationships/account",
          "related": "/api/v2/watchlists/88/account"
        }
      },
      "entities": {
        "links": {
          "self": "/api/v2/watchlists/88/relationships/entities",
          "related": "/api/v2/watchlists/88/entities"
        }
      }
    }
  }
}

Params

Param name Description
id
required

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

watchlist information

Validations:

  • Must be a Hash

data[type]
optional

Validations:

data[relationships]
optional

Validations:

  • Must be a Hash

data[relationships][account]
optional

Validations:

  • Must be a Hash

data[relationships][account][data]
optional

Validations:

  • Must be a Hash

data[relationships][account][data][type]
optional

Account type, which is `accounts`

Validations:

  • Must be a String

data[relationships][account][data][id]
optional

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]
optional

Validations:

  • Must be a Hash

data[relationships][watchable][data]
optional

Validations:

  • Must be a Hash

data[relationships][watchable][data][type]
optional

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

Validations:

  • Must be a String

data[relationships][watchable][data][id]
optional

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.


PATCH /apiv2/watchlists/:id/remove_entities
Remove entities to the watchlist

Examples

PATCH /api/v2/watchlists/48/remove_entities
{
  "data": {
    "id": "48",
    "type": "watchlists",
    "attributes": {
      "name": "My Portfolio"
    },
    "relationships": {
      "entities": {
        "data": [
          {
            "type": "entities",
            "id": "26"
          }
        ]
      }
    }
  }
}
200
{
  "data": {
    "id": "48",
    "type": "watchlists",
    "links": {
      "self": "/api/v2/watchlists/48"
    },
    "attributes": {
      "name": "My Portfolio"
    },
    "relationships": {
      "account": {
        "links": {
          "self": "/api/v2/watchlists/48/relationships/account",
          "related": "/api/v2/watchlists/48/account"
        }
      },
      "entities": {
        "links": {
          "self": "/api/v2/watchlists/48/relationships/entities",
          "related": "/api/v2/watchlists/48/entities"
        }
      }
    }
  }
}

Params

Param name Description
id
required

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

watchlist information

Validations:

  • Must be a Hash

data[type]
optional

Validations:

data[relationships]
optional

Validations:

  • Must be a Hash

data[relationships][account]
optional

Validations:

  • Must be a Hash

data[relationships][account][data]
optional

Validations:

  • Must be a Hash

data[relationships][account][data][type]
optional

Account type, which is `accounts`

Validations:

  • Must be a String

data[relationships][account][data][id]
optional

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]
optional

Validations:

  • Must be a Hash

data[relationships][watchable][data]
optional

Validations:

  • Must be a Hash

data[relationships][watchable][data][type]
optional

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

Validations:

  • Must be a String

data[relationships][watchable][data][id]
optional

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.


DELETE /apiv2/watchlists/:id
Delete a watchlist

Examples

DELETE /api/v2/watchlists/68
204
{}

Params

Param name Description
id
required

watchlist 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.