---
title: "Get Publish Credentials"
method: GET
path: "/workspaces/{workspace_id}/projects/{project_id}/credentials"
tags: ["Publish Credentials"]
---

# Get Publish Credentials

`GET /workspaces/{workspace_id}/projects/{project_id}/credentials`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/projects/{project_id}/credentials`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

Retrieve publish credentials for a given ODBC type and project ID

## Path parameters

- `workspace_id` integer, required: Workspace refers to a collection of projects. Workspace ID is unique identifier for workspace.
- `project_id` integer, required: Project ID of the workspace

## Query parameters

- `odbc_type` 'postgres' | 'bigquery', required: ODBC Type for the connection

## Response `200`

Get Publish Credentials Success

- union
  - BigqueryPublishCredsSchema
    - `dataset` string, required: Dataset name
    - `service_account_json` ServiceAccountJsonSchema
      - `type` string, required: Type of the service account
      - `project_id` string, required: Project ID of the service account
      - `client_email` string, required: Client email of the service account
      - `auth_uri` string, required: Auth URI of the service account
      - `token_uri` string, required: Token URI of the service account
      - `auth_provider_x509_cert_url` string, required: Auth Provider X509 Cert URL of the service account
      - `client_x509_cert_url` string, required: Client X509 Cert URL of the service account
      - `universe_domain` string, required: Universe Domain of the service account
    - `service_account_json_url` string, required: URL for the service account JSON
  - PostgresPublishCredsSchema
    - `database` string, required: Database name
    - `host_ip` string, required: Host IP address
    - `port` integer, required: Port number
    - `username` string, required: Username for the connection
    - `password` string, required: Password for the connection

## Other responses

- `400`: Bad Request
- `401`: Authorization error
- `403`: Request forbidden -- authorization will not help

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/4b2c943a00dc?raw)
