---
title: "Provision Group Chat"
method: POST
path: "/api/group-chat/provision"
tags: ["group-chat"]
---

# Provision Group Chat

`POST /api/group-chat/provision`

Idempotently provisions:
  1. A Mattermost team for the user's church (if missing)
  2. A Mattermost user for the caller (if missing)
  3. Membership in the team
  4. A fresh PAT for the user

Returns the credentials the RN client needs to connect via WebSocket.

## Headers

- `x-user-id` string, nullable

## Response `200`

Successful Response

- ProvisionResponse
  - `mattermost_url` string, required
  - `team_id` string, required
  - `channel_id` string, required
  - `user_id` string, required
  - `access_token` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/usecreed/apis/creed-api.md) · [All operations](https://skmtc.net/usecreed/apis/creed-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/usecreed/creed-api/revisions/523833f9e819/schema)
