arazzo: 1.0.1
info:
title: GitHub Onboard a Member into an Organization
summary: Confirm an organization exists, then set a user's membership role in it.
description: >-
A membership onboarding pattern. The workflow reads the organization to
confirm it exists and to capture its identifier, then sets the membership
role for a user, which invites the user when they are not yet a member and
updates their role when they already are. 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: orgsApi
url: ../openapi/github-orgs-api-openapi.yml
type: openapi
workflows:
- workflowId: onboard-org-member
summary: Verify an organization then set a user's membership role.
description: >-
Reads the organization to confirm it exists and then sets the membership
role for the supplied user.
inputs:
type: object
required:
- githubToken
- org
- username
- role
properties:
githubToken:
type: string
description: A GitHub token with org admin scope, passed as a Bearer credential.
org:
type: string
description: The login of the organization.
username:
type: string
description: The handle of the user to onboard.
role:
type: string
description: The membership role to assign (admin or member).
steps:
- stepId: verifyOrganization
description: >-
Read the organization to confirm it exists before changing membership.
operationId: orgs/get
parameters:
- name: Authorization
in: header
value: Bearer $inputs.githubToken
- name: org
in: path
value: $inputs.org
successCriteria:
- condition: $statusCode == 200
outputs:
orgId: $response.body#/id
orgLogin: $response.body#/login
- stepId: setMembership
description: >-
Set the membership role for the user in the verified organization,
inviting them if they are not yet a member.
operationId: orgs/set-membership-for-user
parameters:
- name: Authorization
in: header
value: Bearer $inputs.githubToken
- name: org
in: path
value: $steps.verifyOrganization.outputs.orgLogin
- name: username
in: path
value: $inputs.username
requestBody:
contentType: application/json
payload:
role: $inputs.role
successCriteria:
- condition: $statusCode == 200
outputs:
membershipState: $response.body#/state
membershipRole: $response.body#/role
membershipUrl: $response.body#/url
outputs:
orgId: $steps.verifyOrganization.outputs.orgId
membershipState: $steps.setMembership.outputs.membershipState
membershipRole: $steps.setMembership.outputs.membershipRole
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
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. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.