ReadMe · Arazzo Workflow

ReadMe Upsert A Category

Version 1.0.0

Find a category by slug and update it if it exists, otherwise create it.

1 workflow 1 source API 1 provider
View Spec View on GitHub DocumentationDeveloper HubAPI ReferencePortalAnalyticsArtificial IntelligenceMCPBi-Directional SyncArazzoWorkflows

Provider

readme

Workflows

upsert-category
Update a category if its slug exists on the branch, otherwise create it.
Lists categories on the branch, looks for one whose slug matches the target, and branches to update the existing category or create a new one.
3 steps inputs: apiKey, branch, order, slug, title outputs: createdSlug, updatedSlug
1
listCategories
{$sourceDescriptions.categoriesApi.url}#/paths/~1branches~1{branch}~1categories/get
List categories on the branch to detect whether the target slug exists.
2
updateCategory
{$sourceDescriptions.categoriesApi.url}#/paths/~1branches~1{branch}~1categories~1{slug}/put
Update the existing category identified by slug.
3
createCategory
{$sourceDescriptions.categoriesApi.url}#/paths/~1branches~1{branch}~1categories/post
Create a new category when no category with the target slug exists.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: ReadMe Upsert A Category
  summary: Find a category by slug and update it if it exists, otherwise create it.
  description: >-
    Keeps a sidebar category in sync without knowing in advance whether it
    already exists. The workflow lists categories on the branch, branches on
    whether a category with the target slug is present, and then either updates
    the matched category or creates a new one. Every step spells out its request
    inline so the flow can be read and executed without opening the underlying
    OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: categoriesApi
  url: ../openapi/readme-categories-api-openapi.yml
  type: openapi
workflows:
- workflowId: upsert-category
  summary: Update a category if its slug exists on the branch, otherwise create it.
  description: >-
    Lists categories on the branch, looks for one whose slug matches the target,
    and branches to update the existing category or create a new one.
  inputs:
    type: object
    required:
    - branch
    - slug
    - title
    properties:
      branch:
        type: string
        description: The branch (version) the category lives on.
      slug:
        type: string
        description: The slug of the category to upsert.
      title:
        type: string
        description: The category title to write.
      order:
        type: integer
        description: The sidebar ordering position for the category.
      apiKey:
        type: string
        description: ReadMe API key used as a Bearer token.
  steps:
  - stepId: listCategories
    description: List categories on the branch to detect whether the target slug exists.
    operationPath: '{$sourceDescriptions.categoriesApi.url}#/paths/~1branches~1{branch}~1categories/get'
    parameters:
    - name: branch
      in: path
      value: $inputs.branch
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      categories: $response.body
    onSuccess:
    - name: categoryExists
      type: goto
      stepId: updateCategory
      criteria:
      - context: $response.body
        condition: $[?(@.slug == $inputs.slug)]
        type: jsonpath
    - name: categoryMissing
      type: goto
      stepId: createCategory
      criteria:
      - context: $response.body
        condition: $[?(@.slug == $inputs.slug)].length == 0
        type: jsonpath
  - stepId: updateCategory
    description: Update the existing category identified by slug.
    operationPath: '{$sourceDescriptions.categoriesApi.url}#/paths/~1branches~1{branch}~1categories~1{slug}/put'
    parameters:
    - name: branch
      in: path
      value: $inputs.branch
    - name: slug
      in: path
      value: $inputs.slug
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    requestBody:
      contentType: application/json
      payload:
        title: $inputs.title
        order: $inputs.order
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      slug: $response.body#/slug
    onSuccess:
    - name: done
      type: end
  - stepId: createCategory
    description: Create a new category when no category with the target slug exists.
    operationPath: '{$sourceDescriptions.categoriesApi.url}#/paths/~1branches~1{branch}~1categories/post'
    parameters:
    - name: branch
      in: path
      value: $inputs.branch
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    requestBody:
      contentType: application/json
      payload:
        title: $inputs.title
        type: guide
        order: $inputs.order
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      slug: $response.body#/slug
  outputs:
    updatedSlug: $steps.updateCategory.outputs.slug
    createdSlug: $steps.createCategory.outputs.slug

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/readme-upsert-category-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.