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

# POST /v1/workflows/resolve-or-create

Resolve or create a caller-owned workflow by stable key. This compatibility
route is for older or intentionally local-only workspaces. New workspace
initialization should list competition workflows first, then use the
create-from-manifest route for a separate workflow or bind an explicitly
selected workflow.

Auth: Droyd API key or signed-in user bearer token. Alias: `POST /api/v1/workflows/resolve-or-create`. Accepted status values are `active`, `paused`, `completed`, and `archived`. A matching caller-owned key updates manifest metadata and competition linkage, so do not use this route to decide fresh-versus-resume. `current` is not accepted; it is a local lock-file pointer only. Validation failures return 400, inactive/unauthorized callers return 401/403, missing competition linkage returns 404, and dependencies may return 500.


## OpenAPI

````yaml api-key.openapi.json POST /v1/workflows/resolve-or-create
openapi: 3.1.0
info:
  title: Droyd API-key Automation API
  version: 1.0.0
  description: >-
    The production API contract for Droyd API-key automations. It contains only
    operations that accept a Droyd API key. `/v1` is canonical; `/api/v1` is a
    compatibility alias.
servers: []
security:
  - droydApiKeyBearer: []
  - droydApiKeyHeader: []
tags:
  - name: Identity
    description: Account-scoped automation identity and onboarding state.
  - name: Workflows
    description: Caller-owned workflows and research nodes.
  - name: Competitions
    description: Competition readiness, submissions, and race entries.
  - name: Experiments
    description: Experiments, artifacts, agent versions, and evaluations.
  - name: Usage
    description: Caller-owned evaluation usage.
  - name: Billing
    description: Caller-owned prepaid credit balances and funding.
paths:
  /v1/workflows/resolve-or-create:
    post:
      tags:
        - Workflows
      summary: Resolve a stable workflow key or create a workflow.
      operationId: resolveOrCreateWorkflow
      requestBody:
        $ref: '#/components/requestBodies/WorkflowResolveOrCreate'
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  requestBodies:
    WorkflowResolveOrCreate:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - key
              - title
            properties:
              key:
                type: string
              title:
                type: string
              description:
                type:
                  - string
                  - 'null'
              competition_slug:
                type: string
              manifest_schema_version:
                type: integer
                minimum: 1
                maximum: 100
              manifest_hash:
                type: string
              manifest:
                type: object
                additionalProperties: true
              status:
                type: string
                enum:
                  - active
                  - paused
                  - completed
                  - archived
  responses:
    Success:
      description: Successful response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SuccessEnvelope'
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: Account state or route policy prevents the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    ServerError:
      description: >-
        The request could not be completed. Retry only when the operation's
        idempotency contract permits it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  schemas:
    SuccessEnvelope:
      type: object
      required:
        - ok
      properties:
        ok:
          const: true
      additionalProperties: true
    ErrorEnvelope:
      type: object
      required:
        - ok
        - error
      properties:
        ok:
          const: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    droydApiKeyBearer:
      type: http
      scheme: bearer
      bearerFormat: Droyd API key
      description: A Droyd API key in the Authorization Bearer slot.
    droydApiKeyHeader:
      type: apiKey
      in: header
      name: x-droyd-api-key
      description: A Droyd API key when Authorization is absent.

````