Create a Metric

POST /metrics

Create a new metric for a company.

application/json

Body Required

  • metric object
    Hide metric attributes Show metric attributes object
    • name string Required

      Name of the metric

    • frequency string Required

      Frequency of the metric reporting

      Values are daily, weekly, monthly, or quarterly.

    • unit string Required

      Unit of measurement (number, percent, or ISO4217 currency code)

    • company_id string(uuid) Required

      ID of the company or fund

Responses

  • 201 application/json

    Metric successfully created

    Hide response attribute Show response attribute object
    • metric object
      Hide metric attributes Show metric attributes object
      • id string(uuid) Required

        Unique identifier for the metric

      • name string Required

        Name of the metric

      • frequency string Required

        Frequency of the metric reporting

        Values are daily, weekly, monthly, or quarterly.

      • unit string Required

        Unit of measurement (number, percent, or ISO4217 currency code)

      • portfolio_company_profile_id string | null

        ID of the associated portfolio company profile

      • company_id string(uuid) Required

        ID of the company or fund

      • created_at string(date-time)

        When the metric was created

  • 400 application/json

    Bad Request - The request is invalid or malformed

    Hide response attribute Show response attribute object
    • errors array[object] Required

      Single error item. Different error types can include different fields.

      Hide errors attributes Show errors attributes object
      • type string

        Machine-readable error type

      • field string

        The related field, if applicable

      • message string

        Human-readable error message

  • 401 application/json

    Unauthorized - Invalid or missing authentication token

    Hide response attribute Show response attribute object
    • errors array[object] Required

      Single error item. Different error types can include different fields.

      Hide errors attributes Show errors attributes object
      • type string

        Machine-readable error type

      • field string

        The related field, if applicable

      • message string

        Human-readable error message

  • 422 application/json

    Unprocessable Entity - The request is valid but contains semantic errors

    Hide response attribute Show response attribute object
    • errors array[object] Required

      Single error item. Different error types can include different fields.

      Hide errors attributes Show errors attributes object
      • type string

        Machine-readable error type

      • field string

        The related field, if applicable

      • message string

        Human-readable error message

  • 429 application/json

    Too Many Requests - Rate limit exceeded

    Hide response attribute Show response attribute object
    • errors array[object] Required

      Single error item. Different error types can include different fields.

      Hide errors attributes Show errors attributes object
      • type string

        Machine-readable error type

      • field string

        The related field, if applicable

      • message string

        Human-readable error message

POST /metrics
curl \
 --request POST 'https://api.visible.vc/metrics' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"metric":{"name":"Revenue","unit":"USD","frequency":"monthly","company_id":"c85cb869-40c0-4b8f-829a-30cdeb673ce0"}}'
Request example
{
  "metric": {
    "name": "Revenue",
    "unit": "USD",
    "frequency": "monthly",
    "company_id": "c85cb869-40c0-4b8f-829a-30cdeb673ce0"
  }
}
Response examples (201)
{
  "metric": {
    "id": "3c5728ed-a09e-4245-bb33-459b67600be3",
    "name": "Revenue",
    "unit": "USD",
    "frequency": "monthly",
    "company_id": "c85cb869-40c0-4b8f-829a-30cdeb673ce0",
    "created_at": "2018-08-05T08:40:51.620Z",
    "portfolio_company_profile_id": "ec5252fe-9abc-4096-85e9-1374e70a3182"
  }
}
Response examples (400)
{
  "errors": [
    {
      "type": "parameter_invalid",
      "field": "filter",
      "message": "must be an object"
    }
  ]
}
Response examples (401)
{
  "errors": [
    {
      "type": "unauthorized"
    }
  ]
}
Response examples (422)
{
  "errors": [
    {
      "type": "attribute_invalid",
      "field": "value",
      "message": "required"
    }
  ]
}
Response examples (429)
{
  "errors": [
    {
      "type": "rate_limit_exceeded"
    }
  ]
}