{
  "opencollection": "1.0.0",
  "info": {
    "name": "Amigo Account Use Cases API",
    "version": "0.1.0"
  },
  "request": {
    "auth": {
      "type": "bearer",
      "token": "{{bearerToken}}"
    }
  },
  "items": [
    {
      "info": {
        "name": "Use Cases",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "List channel use cases",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.amigo.ai/v1/:workspace_id/use-cases",
            "params": [
              {
                "name": "workspace_id",
                "value": "",
                "type": "path"
              },
              {
                "name": "entity_name",
                "value": "",
                "type": "query"
              },
              {
                "name": "channel",
                "value": "",
                "type": "query"
              },
              {
                "name": "setup_id",
                "value": "",
                "type": "query"
              }
            ]
          },
          "docs": "List use cases with optional filters by entity_name, channel, setup_id. Requires Channel.view permission."
        },
        {
          "info": {
            "name": "List use cases this workspace owns",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.amigo.ai/v1/:workspace_id/use-cases/ownership",
            "params": [
              {
                "name": "workspace_id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Return the ids of the channel-manager use cases this workspace owns. Requires Channel.view permission."
        },
        {
          "info": {
            "name": "Check whether this workspace owns a use case",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.amigo.ai/v1/:workspace_id/use-cases/:use_case_id/ownership",
            "params": [
              {
                "name": "workspace_id",
                "value": "",
                "type": "path"
              },
              {
                "name": "use_case_id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Return the ownership record if the current workspace owns the use case, or 404 if it does not (no existence leak). Requires Channel.view permission."
        },
        {
          "info": {
            "name": "Assign ownership of a use case to this workspace",
            "type": "http"
          },
          "http": {
            "method": "PUT",
            "url": "https://api.amigo.ai/v1/:workspace_id/use-cases/:use_case_id/ownership",
            "params": [
              {
                "name": "workspace_id",
                "value": "",
                "type": "path"
              },
              {
                "name": "use_case_id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Claim ownership of a channel-manager use case for the current workspace. Idempotent — re-assigning an already-owned use case returns 200. 404 if the use case does not exist in channel-manager. 409 if the use case is already owned by another workspace. Requires Channel.ManageOwnership permission (admin tier)."
        },
        {
          "info": {
            "name": "Release this workspace's ownership of a use case",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://api.amigo.ai/v1/:workspace_id/use-cases/:use_case_id/ownership",
            "params": [
              {
                "name": "workspace_id",
                "value": "",
                "type": "path"
              },
              {
                "name": "use_case_id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Release the current workspace's ownership of a use case. Refuses (409) while any service still binds the use case — call DELETE `/use-cases/{id}/service-binding` first. 404 if this workspace does not own the use case. Requires Channel.ManageOwnership permission (admin tier)."
        },
        {
          "info": {
            "name": "Get the service binding for a use case",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.amigo.ai/v1/:workspace_id/use-cases/:use_case_id/service-binding",
            "params": [
              {
                "name": "workspace_id",
                "value": "",
                "type": "path"
              },
              {
                "name": "use_case_id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Return the platform service this use case is bound to in this workspace, or 404 if unbound. Requires Channel.view permission."
        },
        {
          "info": {
            "name": "Bind a use case to a platform service",
            "type": "http"
          },
          "http": {
            "method": "PUT",
            "url": "https://api.amigo.ai/v1/:workspace_id/use-cases/:use_case_id/service-binding",
            "params": [
              {
                "name": "workspace_id",
                "value": "",
                "type": "path"
              },
              {
                "name": "use_case_id",
                "value": "",
                "type": "path"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Bind this use case to a platform service in the current workspace. PUT semantics — rebinding to a different service replaces the prior binding. Inbound webhook events for the use case will resolve to this workspace; outbound dispatch from the service will route through this use case for its channel. 409 if a different use case already binds the same (service, channel) pair. 404 if the service or use case is missing or belongs to another workspace. Requires Channel.create permission."
        },
        {
          "info": {
            "name": "Unbind a use case from its platform service",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://api.amigo.ai/v1/:workspace_id/use-cases/:use_case_id/service-binding",
            "params": [
              {
                "name": "workspace_id",
                "value": "",
                "type": "path"
              },
              {
                "name": "use_case_id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Release a use case from its bound service in this workspace. Soft-delete on the binding row. 404 if the use case is not currently bound (covers both 'never bound' and 'already unbound'). Requires Channel.delete permission."
        }
      ]
    }
  ],
  "bundled": true
}