> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usecontextlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Assign an account to a declared connection



## OpenAPI

````yaml https://platform.usecontextlayer.com/api/openapi.json post /slates/{target}/connections/assign
openapi: 3.1.0
info:
  title: ContextLayer Platform
  version: 0.1.0
servers:
  - url: https://platform.usecontextlayer.com/api
security: []
tags:
  - name: Slates
  - name: Slate routing
  - name: Slate resources
  - name: Accounts
  - name: Shared secrets
  - name: Agents
  - name: Agent jobs
paths:
  /slates/{target}/connections/assign:
    post:
      tags:
        - Slate resources
      summary: Assign an account to a declared connection
      operationId: assignSlateConnection
      parameters:
        - schema:
            anyOf:
              - type: string
                format: uuid
              - type: string
          required: true
          name: target
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                account_id:
                  type: string
                  minLength: 1
                slug:
                  type: string
                  minLength: 1
              required:
                - account_id
                - slug
              additionalProperties: false
      responses:
        '200':
          description: Saved viewer or owner connection assignment
          content:
            application/json:
              schema:
                type: object
                properties:
                  account_id:
                    type: string
                    minLength: 1
                  slug:
                    type: string
                    minLength: 1
                required:
                  - account_id
                  - slug
        '400':
          description: Invalid assignment
        '401':
          description: A valid ContextLayer login is required
        '403':
          description: Slate viewing or Owner account management is forbidden
        '404':
          description: Slate or connection requirement not found
        '409':
          description: Nothing has been pushed to the slate's main branch yet
          content:
            application/json:
              schema:
                type: object
                properties:
                  reason:
                    type: string
                    enum:
                      - no-commit
                required:
                  - reason
      security:
        - bearerAuth: []
        - webCookie: []
        - localWebCookie: []
components:
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
    webCookie:
      in: cookie
      name: __Secure-better-auth.session_token
      type: apiKey
    localWebCookie:
      in: cookie
      name: better-auth.session_token
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.