---
title: REST API Endpoints
slug: rest-api-endpoints
createdAt: 2024-08-01T21:08:17.404Z
---

We support a number of both server-side and client-side implementation patterns, including no-code solutions.

We also support both REST and Websocket (JSON RPC) style integrations. If you aren't sure where to start, feel free to contact us and we'll discuss what works best for your use case.

## Accounts

:::ApiMethodV2
```json
{
  "name": "Create or Update Account",
  "method": "POST",
  "url": "https://<customer>-control.kickplan.dev/api/accounts",
  "description": "",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "WZEz2-GQ1AXkT4r7Ez4Hg",
        "language": "curl",
        "code": "curl --location 'https://<customer>-control.kickplan.dev/api/accounts' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\"key\":\"acme\",\"name\":\"Acme\",\"custom_fields\":{\"salesforce_id\": \"12345\"},\"account_plans\":[{\"plan_key\":\"essentials\"}],\"feature _overrides\":[{\"feature_key\":\"metrics\",\"variant_key\":\"true\"},{\"feature_key\":\"chat\",\"variant_key\":\"off\"}]}'",
        "customLabel": ""
      },
      {
        "id": "6dLenLFDR9LazcqYSXQcj",
        "language": "ruby",
        "code": "# sample for a Rails app\nKickplan::Accounts.create(\n  key: \"acme\",\n  name: \"Acme\",\n  account_plans: [{ plan_key: \"essentials\" }],\n  custom_fields: { \"salesforce-id\": \"12345\"},\n  feature_overrides: [{\n    feature_key: \"metrics\", \n    variant_key: \"true\"\n  },\n  {\n    feature_key: \"chat\", \n    variant_key: \"off\"\n  }]\n)\n \nKickplan::Accounts.update(\"acme\", {\n  name: \"Acme, Inc.\",\n  account_plans: [{ plan_key: \"professional\" }],\n  custom_fields: { \"salesforce-id\": \"12345\"},\n  feature_overrides: [{\n    feature_key: \"metrics\", \n    variant_key: \"false\"\n  },\n  {\n    feature_key: \"chat\", \n    variant_key: \"on\"\n  }]\n)",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "WZEz2-GQ1AXkT4r7Ez4Hg"
  },
  "results": {
    "languages": [
      {
        "id": "Pr0KSmIPT-gHU_0iru8DX",
        "language": "200",
        "customLabel": "",
        "code": "{\n  \"feature_overrides\": [\"metrics/true\", \"chat/off\"],\n  \"inserted_at\": \"2024-02-22T20:07:44.706979Z\", \n  \"key\": \"acme\",\n  \"name\": \"Acme Inc.\",\n  \"plans\": [\"essentials\"],\n  \"updated_at\": \"2024-02-22T20:07:44.706979Z\"\n}"
      },
      {
        "id": "XEa5Racn62hUT39Sr0Q5E",
        "language": "400",
        "code": "# example response\n{\n    \"message\": \"Invalid input\",\n    \"type\": \"INVALID_INPUT\",\n    \"errors\": [\n        {\n            \"field\": \"key\",\n            \"message\": \"is required\",\n            \"type\": \"INVALID\"\n        }\n    ]\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "Pr0KSmIPT-gHU_0iru8DX"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "name": "key",
        "kind": "required",
        "type": "string",
        "description": "ID of the account"
      },
      {
        "name": "name",
        "kind": "optional",
        "type": "string",
        "description": "Name of the account",
        "children": []
      },
      {
        "name": "custom_fields",
        "kind": "optional",
        "type": "Object",
        "description": "Custom fields to set for the account. Each custom field is a key: value pair.",
        "children": [
          {
            "name": "custom_field_key",
            "kind": "optional",
            "type": "string",
            "description": "Custom field key (defined in Kickplan console settings)"
          }
        ]
      },
      {
        "name": "account_plans",
        "kind": "optional",
        "type": "Array",
        "description": "Array of plans the account is subscribed to. Each array element is an object: { plan_key: \"value\" }.",
        "children": []
      },
      {
        "name": "feature _overrides",
        "kind": "optional",
        "type": "Array",
        "description": "Array of feature overrides to set for the account. Each array element is an object: { feature_key: \"value\", variant_key: \"value\" }.",
        "children": []
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::

## Features

:::ApiMethodV2
```json
{
  "name": "Resolve Single Feature",
  "method": "POST",
  "url": "https://<customer>-console.kickplan.dev/api/features/<feature-key>/resolve",
  "description": "",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "WZEz2-GQ1AXkT4r7Ez4Hg",
        "language": "curl",
        "code": "curl --location 'https://customer-control.kickplan.dev/api/features/upload-contacts/resolve' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\"detailed\":\"true\",\"context\":{\"account_key\": \"12345\"}}'",
        "customLabel": ""
      },
      {
        "id": "6dLenLFDR9LazcqYSXQcj",
        "language": "ruby",
        "code": "# sample for a Rails app, see Ruby SDK for more\n\n# resolve globally\nKickplan::Features.resolve(\"upload-contacts\")\n\n# resolve for an account\nKickplan::Features.resolve(\"upload-contacts\", { context: { account_key: \"acme\"}})\n\n# resolve with detailed response\nKickplan::Features.resolve(\"upload-contacts\", detailed: true)\n",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "6dLenLFDR9LazcqYSXQcj"
  },
  "results": {
    "languages": [
      {
        "id": "Pr0KSmIPT-gHU_0iru8DX",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"value\": true,\n    \"metadata\": {\n        \"name\": \"Upload Contacts\"\n    },\n    \"key\": \"upload-contacts\",\n    \"error_code\": null,\n    \"variant\": \"true\"\n}\n\n# response when no account found\n{\n    \"value\": false,\n    \"metadata\": {\n        \"name\": \"Upload Contacts\"\n    },\n    \"key\": \"upload-contacts\",\n    \"error_code\": null,\n    \"variant\": \"false\"\n}"
      }
    ],
    "selectedLanguageId": "Pr0KSmIPT-gHU_0iru8DX"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "name": "detailed",
        "kind": "optional",
        "type": "Boolean",
        "description": "whether to retrieve all details associated with the feature, or just the value."
      },
      {
        "name": "context",
        "kind": "required",
        "type": "Object",
        "description": "Name of the account",
        "children": [
          {
            "name": "account_key",
            "kind": "required",
            "type": "string",
            "description": "account key"
          }
        ]
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::

:::ApiMethodV2
```json
{
  "name": "Resolve All Features",
  "method": "POST",
  "url": "https://<customer>-console.kickplan.dev/api/features/resolve",
  "description": "",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "WZEz2-GQ1AXkT4r7Ez4Hg",
        "language": "curl",
        "code": "curl --location 'https://customer-control.kickplan.dev/api/features/resolve' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\"detailed\":\"true\",\"context\":{\"account_key\": \"12345\"}}'",
        "customLabel": ""
      },
      {
        "id": "6dLenLFDR9LazcqYSXQcj",
        "language": "ruby",
        "code": "# sample for a Rails app, see Ruby SDK for more\n\n# resolve all features globally\nKickplan::Features.resolve()\n\n# resolve all features for an account\nKickplan::Features.resolve({ context: { account_key: \"acme\"}})\n\n# resolve with detailed response\nKickplan::Features.resolve(detailed: true)\n",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "6dLenLFDR9LazcqYSXQcj"
  },
  "results": {
    "languages": [
      {
        "id": "Pr0KSmIPT-gHU_0iru8DX",
        "language": "200",
        "customLabel": "",
        "code": "[\n  {\n    \"value\": true,\n    \"key\": \"upload-contacts\",\n  },\n  {\n    \"value\": false,\n    \"key\": \"chat\",\n  }\n]"
      }
    ],
    "selectedLanguageId": "Pr0KSmIPT-gHU_0iru8DX"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "name": "detailed",
        "kind": "optional",
        "type": "Boolean",
        "description": "whether to retrieve all details associated with the feature, or just the value."
      },
      {
        "name": "context",
        "kind": "required",
        "type": "Object",
        "description": "Name of the account",
        "children": [
          {
            "name": "account_key",
            "kind": "required",
            "type": "string",
            "description": "account key"
          }
        ]
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::

## Metrics

:::ApiMethodV2
```json
{
  "name": "Set a Metric",
  "method": "POST",
  "url": "https://<customer>-console.kickplan.dev/api/metrics/set",
  "description": "",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "WZEz2-GQ1AXkT4r7Ez4Hg",
        "language": "curl",
        "code": "curl --location 'https://customer-control.kickplan.dev/api/metrics/set' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\"key\":\"true\",\"value\":1,\"account_key\":\"12345\",\"idempotency_key\":\"test-key\",\"time\":\"2024-04-29T12:20:34-07:00\"}'",
        "customLabel": ""
      },
      {
        "id": "6dLenLFDR9LazcqYSXQcj",
        "language": "ruby",
        "code": "# sample for a Rails app, see Ruby SDK for more\n\n# set metric for an account\nKickplan::Metrics.set(\n  key: \"seats\", \n  value: \"5\", \n  account_key: \"acme\", \n  idempotency_key: \"some-key\",\n  time: \"2024-04-29T12:20:34-07:00\"\n)",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "6dLenLFDR9LazcqYSXQcj"
  },
  "results": {
    "languages": [
      {
        "id": "Pr0KSmIPT-gHU_0iru8DX",
        "language": "202",
        "customLabel": "",
        "code": ""
      }
    ],
    "selectedLanguageId": "Pr0KSmIPT-gHU_0iru8DX"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "name": "key",
        "kind": "required",
        "type": "String",
        "description": "Metric key"
      },
      {
        "name": "value",
        "kind": "required",
        "type": "Integer",
        "description": "Metric value",
        "children": [
          {
            "name": "account_key",
            "kind": "required",
            "type": "string",
            "description": "account key"
          }
        ]
      },
      {
        "name": "account_key",
        "kind": "required",
        "type": "String",
        "description": "Account key",
        "children": []
      },
      {
        "name": "idempotency_key",
        "kind": "optional",
        "type": "string",
        "description": "",
        "children": []
      },
      {
        "name": "time",
        "kind": "optional",
        "type": "string",
        "description": "Datetime in ISO 8601 format.",
        "children": []
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::



