Skip to main content
POST
/
postgresgateway
Python SDK
import os
from cognite.client.data_classes.postgres_gateway import UserWrite, SessionCredentials
from cognite.client.data_classes import ClientCredentials
session = client.iam.sessions.create(
    ClientCredentials(os.environ["IDP_CLIENT_ID"], os.environ["IDP_CLIENT_SECRET"]),
    session_type="CLIENT_CREDENTIALS"
)
user = UserWrite(credentials=SessionCredentials(nonce=session.nonce))
res = client.postgres_gateway.users.create(user)
{
  "items": [
    {
      "host": "fdw.<CLUSTER>.cogniteapp.com",
      "username": "<string>",
      "password": "<string>",
      "createdTime": 1730204346000,
      "lastUpdatedTime": 1730204346000,
      "sessionId": 4503599627370496
    }
  ]
}

Authorizations

Authorization
string
header
required

Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to accept OpenID Connect tokens. Use a header key of 'Authorization' with a value of 'Bearer $accesstoken'. The token can be obtained through any flow supported by the identity provider.

Body

application/json

List of postgres users to create

items
Create User · object[]
required
Required array length: 1 element

Response

List of created users

items
Items · object[]
required
Required array length: 1 element
Last modified on April 23, 2026