---
title: "Set Firestore Credentials"
method: POST
path: "/api/set_firestore_credentials"
---

# Set Firestore Credentials

`POST /api/set_firestore_credentials`

Set Firestore credentials for authenticated user using GCP Service Account.

This endpoint configures Firestore access using a GCP Service Account.
Collection-level access is controlled programmatically via allowed_collections.

Payload:
{
    "project_id": "your-gcp-project",  # GCP project ID (required)
    "service_account_key": {...},  # Service account JSON key (required)
    "allowed_collections": ["users", "orders", "products/*/reviews"]  # Optional
}

Setup steps for the customer:
1. Create a GCP Service Account with Firestore Viewer role (roles/datastore.viewer)
2. Generate a JSON key for the service account
3. Provide the JSON key and optionally specify which collections to allow access to

Security notes:
- Service account has IAM-level access to Firestore (database-wide)
- Collection-level restrictions are enforced programmatically by Deeptrace
- Credentials are encrypted at rest
- Wildcards supported in allowed_collections (e.g., "users/*/orders")

## Response `200`

Successful Response

- unknown

---

[API](https://skmtc.net/deeptrace/apis/fastapi.md) · [All operations](https://skmtc.net/deeptrace/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deeptrace/fastapi/versions/1af581120ec0/schema)
