arazzo: 1.0.1
info:
title: X Pin the Authenticated User's First Owned List
summary: List the owned Lists, then pin the first one to the user's profile.
description: >-
Pins a List that the authenticated user owns without needing to know the
List id in advance. The workflow enumerates the user's owned Lists, takes
the first one, and pins it. The pin step inlines its list_id body so the
chain reads and executes without opening the underlying OpenAPI description.
version: 1.0.0
sourceDescriptions:
- name: listsApi
url: ../openapi/twitter-lists-api-openapi.yml
type: openapi
workflows:
- workflowId: pin-owned-list
summary: Find the user's first owned List and pin it.
description: >-
Chains the owned-lists endpoint into the pin-list endpoint, branching to a
no-op end when the user owns no Lists.
inputs:
type: object
required:
- authUserId
properties:
authUserId:
type: string
description: The numeric id of the authenticated user who owns the Lists.
authorization:
type: string
description: OAuth2 user token to authorize the requests (e.g. "Bearer xxx").
steps:
- stepId: ownedLists
description: List the Lists owned by the authenticated user.
operationId: getUsersOwnedLists
parameters:
- name: id
in: path
value: $inputs.authUserId
- name: max_results
in: query
value: 100
- name: list.fields
in: query
value: id,name,private
- name: Authorization
in: header
value: $inputs.authorization
successCriteria:
- condition: $statusCode == 200
outputs:
firstListId: $response.body#/data/0/id
onSuccess:
- name: hasLists
type: goto
stepId: pinList
criteria:
- context: $response.body
condition: $.data.length > 0
type: jsonpath
- name: noLists
type: end
criteria:
- context: $response.body
condition: $.data.length == 0
type: jsonpath
- stepId: pinList
description: Pin the first owned List to the authenticated user's profile.
operationId: pinList
parameters:
- name: id
in: path
value: $inputs.authUserId
- name: Authorization
in: header
value: $inputs.authorization
requestBody:
contentType: application/json
payload:
list_id: $steps.ownedLists.outputs.firstListId
successCriteria:
- condition: $statusCode == 200
outputs:
pinned: $response.body#/data/pinned
outputs:
firstListId: $steps.ownedLists.outputs.firstListId
pinned: $steps.pinList.outputs.pinned
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.