arazzo: 1.0.1
info:
title: Microsoft Office 365 Notify New User
summary: Create a user, then send a welcome email to their new mailbox address.
description: >-
A cross-resource onboarding flow spanning the Users and Mail resources. The
workflow creates a new user, reads the user back to capture the resolved
userPrincipalName, and then sends a welcome email addressed to that user from
the signed-in account. The create returns 201 and the sendMail action returns
202 Accepted. 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
x-realizes-capability-ids:
- BC-620.20
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-620.20
capability_name: Identity & Access Management
spec: microsoft-office-365-users-api-openapi.yml
confidence: 0.7
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: mailApi
url: ../openapi/microsoft-office-365-mail-api-openapi.yml
type: openapi
- name: usersApi
url: ../openapi/microsoft-office-365-users-api-openapi.yml
type: openapi
workflows:
- workflowId: notify-new-user
summary: Provision a user and email them a welcome message.
description: >-
Creates a user via POST /users (201), reads it via GET /users/{user-id}
(200), then sends a welcome email via POST /me/sendMail (202).
inputs:
type: object
required:
- displayName
- mailNickname
- userPrincipalName
- password
- welcomeBody
properties:
displayName:
type: string
description: The display name for the new user.
mailNickname:
type: string
description: The mail alias for the new user.
userPrincipalName:
type: string
description: The user principal name, also used as the welcome email recipient.
password:
type: string
description: The initial password for the user.
welcomeBody:
type: string
description: The plain-text body of the welcome email.
steps:
- stepId: createUser
description: Create a new, enabled user account.
operationId: $sourceDescriptions.usersApi.createUser
requestBody:
contentType: application/json
payload:
accountEnabled: true
displayName: $inputs.displayName
mailNickname: $inputs.mailNickname
userPrincipalName: $inputs.userPrincipalName
passwordProfile:
forceChangePasswordNextSignIn: true
password: $inputs.password
successCriteria:
- condition: $statusCode == 201
outputs:
userId: $response.body#/id
- stepId: readUser
description: >-
Read the created user back to capture the resolved userPrincipalName for
addressing the welcome email.
operationId: $sourceDescriptions.usersApi.getUser
parameters:
- name: user-id
in: path
value: $steps.createUser.outputs.userId
successCriteria:
- condition: $statusCode == 200
outputs:
recipientAddress: $response.body#/userPrincipalName
displayName: $response.body#/displayName
- stepId: sendWelcome
description: >-
Send a welcome email from the signed-in account to the new user's address.
Returns 202 Accepted.
operationId: $sourceDescriptions.mailApi.sendMail
requestBody:
contentType: application/json
payload:
message:
subject: Welcome to the organization
body:
contentType: text
content: $inputs.welcomeBody
toRecipients:
- emailAddress:
address: $steps.readUser.outputs.recipientAddress
name: $steps.readUser.outputs.displayName
saveToSentItems: true
successCriteria:
- condition: $statusCode == 202
outputs:
notifiedAddress: $steps.readUser.outputs.recipientAddress
outputs:
userId: $steps.createUser.outputs.userId
notifiedAddress: $steps.sendWelcome.outputs.notifiedAddress
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.