X (Twitter) · Arazzo Workflow

X Follow a User by Their Username

Version 1.0.0

Resolve a target handle to an id, then follow that user.

1 workflow 1 source API 1 provider
View Spec View on GitHub Social-MediaMicrobloggingReal-Time DataStreamingAdvertisingContentArazzoWorkflows

Provider

twitter

Workflows

follow-user-by-username
Resolve a username and follow that user as the authenticated account.
Chains the username lookup endpoint into the follow-user endpoint, using the resolved id as the follow target.
2 steps inputs: authUserId, authorization, targetUsername outputs: following, targetUserId
1
resolveTarget
Resolve the target username into a numeric user id.
2
followTarget
Follow the resolved target user as the authenticated user.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: X Follow a User by Their Username
  summary: Resolve a target handle to an id, then follow that user.
  description: >-
    Lets the authenticated user follow another account given only that
    account's public @username. The workflow resolves the username into a
    numeric user id and then issues the follow request, inlining the
    target_user_id in the follow body so the chain reads and executes without
    opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: usersApi
  url: ../openapi/twitter-users-api-openapi.yml
  type: openapi
workflows:
- workflowId: follow-user-by-username
  summary: Resolve a username and follow that user as the authenticated account.
  description: >-
    Chains the username lookup endpoint into the follow-user endpoint, using
    the resolved id as the follow target.
  inputs:
    type: object
    required:
    - authUserId
    - targetUsername
    properties:
      authUserId:
        type: string
        description: The numeric id of the authenticated user who will follow.
      targetUsername:
        type: string
        description: The @username of the account to follow, without the leading @.
      authorization:
        type: string
        description: OAuth2 user token to authorize the requests (e.g. "Bearer xxx").
  steps:
  - stepId: resolveTarget
    description: Resolve the target username into a numeric user id.
    operationId: getUsersByUsername
    parameters:
    - name: username
      in: path
      value: $inputs.targetUsername
    - name: user.fields
      in: query
      value: id,name,username
    - name: Authorization
      in: header
      value: $inputs.authorization
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      targetUserId: $response.body#/data/id
  - stepId: followTarget
    description: Follow the resolved target user as the authenticated user.
    operationId: followUser
    parameters:
    - name: id
      in: path
      value: $inputs.authUserId
    - name: Authorization
      in: header
      value: $inputs.authorization
    requestBody:
      contentType: application/json
      payload:
        target_user_id: $steps.resolveTarget.outputs.targetUserId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      following: $response.body#/data/following
      pendingFollow: $response.body#/data/pending_follow
  outputs:
    targetUserId: $steps.resolveTarget.outputs.targetUserId
    following: $steps.followTarget.outputs.following

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/twitter-follow-user-by-username-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.