> For the complete documentation index, see [llms.txt](https://developerdocs.instructure.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developerdocs.instructure.com/services/canvas/resources/developer_key_account_bindings.md).

# Developer Key Account Bindings

Developer key account bindings API for binding a developer key to a context and specifying a workflow state for that relationship.

#### A DeveloperKeyAccountBinding object looks like: <a href="#developerkeyaccountbinding" id="developerkeyaccountbinding"></a>

```js
{
  // The Canvas ID of the binding
  "id": 1,
  // The global Canvas ID of the account in the binding
  "account_id": 10000000000001,
  // The global Canvas ID of the developer key in the binding
  "developer_key_id": 10000000000008,
  // The workflow state of the binding. Will be one of 'on', 'off', or 'allow.'
  "workflow_state": on,
  // True if the requested context owns the binding
  "account_owns_binding": true
}
```

## [Create a Developer Key Account Binding](#method.developer_key_account_bindings.create_or_update) <a href="#method.developer_key_account_bindings.create_or_update" id="method.developer_key_account_bindings.create_or_update"></a>

[DeveloperKeyAccountBindingsController#create\_or\_update](https://github.com/instructure/canvas-lms/blob/master/app/controllers/developer_key_account_bindings_controller.rb)

#### `POST /api/v1/accounts/:account_id/developer_keys/:developer_key_id/developer_key_account_bindings`

**Scope:** `url:POST|/api/v1/accounts/:account_id/developer_keys/:developer_key_id/developer_key_account_bindings`

Create a new Developer Key Account Binding. The developer key specified in the request URL must be available in the requested account or the requested account's account chain. If the binding already exists for the specified account/key combination it will be updated.

#### Request Parameters:

| Parameter        | Type     | Description                                                                                              |
| ---------------- | -------- | -------------------------------------------------------------------------------------------------------- |
| `workflow_state` | `string` | <p>The workflow state for the binding. Must be one of "on", "off", or "allow".<br>Defaults to "off".</p> |

Returns a [DeveloperKeyAccountBinding](#developerkeyaccountbinding) object.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developerdocs.instructure.com/services/canvas/resources/developer_key_account_bindings.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
