Set up Atlan SDK
Choose your preferred integration approach and follow the steps below. All SDK-based approaches use the same two environment variables for authentication.
Prerequisites
- An Atlan API token with at least one persona assigned
- Your Atlan tenant URL (for example,
https://tenant.atlan.com)
Install and configure
- Python
- Java
- Kotlin
- Scala
- Clojure
- Go
- CLI
- dbt
- Events
- Raw REST API
Walk through step-by-step in our intro to custom integration course (30 mins).
Install
pip install pyatlan
Configure
Option 1—environment variables (recommended)
export ATLAN_BASE_URL=https://tenant.atlan.com
export ATLAN_API_KEY="<your-api-token>"
from pyatlan.client.atlan import AtlanClient
client = AtlanClient()
You can also authenticate with OAuth credentials instead of an API token:
export ATLAN_BASE_URL=https://tenant.atlan.com
export ATLAN_OAUTH_CLIENT_ID=<client-id>
export ATLAN_OAUTH_CLIENT_SECRET=<client-secret>
Option 2—client constructor
from pyatlan.client.atlan import AtlanClient
# Using API token
client = AtlanClient(
base_url="https://tenant.atlan.com",
api_key="<your-api-token>"
)
# Using OAuth credentials
client = AtlanClient(
base_url="https://tenant.atlan.com",
oauth_client_id="<client-id>",
oauth_client_secret="<client-secret>",
)
Avoid hardcoding your API token in source files—you may accidentally commit it to a public repository.
Advanced configuration—logging, retries, timeouts, proxies, async
Logging
import logging
from pyatlan.client.atlan import AtlanClient
logging.basicConfig(level=logging.DEBUG)
client = AtlanClient()
Retries
The SDK retries automatically on 403, 429, and 5xx responses using exponential backoff. The default maximum is 5 retries.
Timeouts
from pyatlan.client.atlan import AtlanClient
client = AtlanClient()
client.read_timeout = 1800.0 # 30 minutes (default: 900s)
client.connect_timeout = 60.0 # 1 minute (default: 30s)
Proxies
export HTTPS_PROXY="http://user:[email protected]:1080"
export SSL_CERT_FILE="/path/to/corporate-ca-cert.pem"
Or programmatically:
client = AtlanClient(proxy="http://10.10.1.10:3128")
Async client
Available from v8.0. Mirrors the synchronous API with async/await:
from pyatlan.client.aio import AsyncAtlanClient
client = AsyncAtlanClient(
base_url="https://tenant.atlan.com",
api_key="<your-api-token>"
)
Multi-tenant connectivity
from pyatlan.client.atlan import AtlanClient
client2 = AtlanClient(base_url="https://tenant2.atlan.com", api_key="...")
Atlan.set_default_client(client2)
GitHub repo · JavaDocs · Release
Walk through step-by-step in our intro to custom integration course (30 mins).
Install
- Gradle
- Maven
repositories {
mavenCentral()
}
dependencies {
implementation "com.atlan:atlan-java:+" // (1)
testRuntimeOnly 'ch.qos.logback:logback-classic:1.2.11' // (2)
}
- Use
+for the latest version, or pin to a specific version. - Logback binds slf4j to stdout at INFO level or above.
<dependency>
<groupId>com.atlan</groupId>
<artifactId>atlan-java</artifactId>
<version>${atlan.version}</version>
</dependency>
Configure
Option 1—environment variables (recommended)
export ATLAN_BASE_URL=https://tenant.atlan.com
export ATLAN_API_KEY="<your-api-token>"
import com.atlan.AtlanClient;
try (AtlanClient client = new AtlanClient()) {
// client is ready
}
Option 2—client constructor
import com.atlan.AtlanClient;
try (AtlanClient client = new AtlanClient("https://tenant.atlan.com", "<your-api-token>")) {
// client is ready
}
Avoid hardcoding your API token in source files—you may accidentally commit it to a public repository.
Advanced configuration—logging, retries, timeouts
Logging (Log4j2)
dependencies {
implementation "com.atlan:atlan-java:+"
implementation "org.apache.logging.log4j:log4j-core:2.22.0"
implementation "org.apache.logging.log4j:log4j-slf4j2-impl:2.22.0"
}
Retries
The SDK retries automatically on connection errors, 403, and 500 responses using exponential backoff with jitter (500ms–5s per retry, default maximum 3 retries).
Configure the maximum:
try (AtlanClient client = new AtlanClient()) {
client.setMaxNetworkRetries(5);
}
Timeouts
Default is 80 seconds. Override with milliseconds:
try (AtlanClient client = new AtlanClient()) {
client.setReadTimeout(120_000); // 2 minutes
}
Kotlin uses the Java SDK from Maven Central.
Install
repositories {
mavenCentral()
}
dependencies {
implementation("com.atlan:atlan-java:+") // (1)
implementation("io.github.microutils:kotlin-logging-jvm:3.0.5")
implementation("org.slf4j:slf4j-simple:2.0.7")
}
- Use
+for the latest version, or pin to a specific version.
Configure
Option 1—environment variables (recommended)
export ATLAN_BASE_URL=https://tenant.atlan.com
export ATLAN_API_KEY="<your-api-token>"
import com.atlan.AtlanClient
fun main() {
AtlanClient().use { client ->
// client is ready
}
}
Option 2—client constructor
import com.atlan.AtlanClient
fun main() {
AtlanClient("https://tenant.atlan.com", "<your-api-token>").use { client ->
// client is ready
}
}
Scala uses the Java SDK from Maven Central.
Install
name := "Main"
version := "1.0"
scalaVersion := "2.13.14"
lazy val main = project
.in(file("."))
.settings(
name := "Main",
libraryDependencies ++= Seq(
"com.atlan" % "atlan-java" % "+", // (1)
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5"
)
)
- Replace
+with the specific version shown in the badge above.
Configure
Option 1—environment variables (recommended)
export ATLAN_BASE_URL=https://tenant.atlan.com
export ATLAN_API_KEY="<your-api-token>"
import com.atlan.AtlanClient
import scala.util.Using
object Main extends App {
Using(new AtlanClient()) { client =>
// client is ready
}
}
Option 2—client constructor
import com.atlan.AtlanClient
import scala.util.Using
object Main extends App {
Using(new AtlanClient("https://tenant.atlan.com", "<your-api-token>")) { client =>
// client is ready
}
}
Clojure uses the Java SDK from Maven Central.
Install
{
:aliases
{
:run {:ns-default my.proj
:main-opts ["-m" "my.proj"]
:jvm-opts ["-Dclojure.tools.logging.factory=clojure.tools.logging.impl/slf4j-factory"]
:deps {
com.atlan/atlan-java {:mvn/version "+"} ;; (1)
org.clojure/tools.logging {:mvn/version "1.3.0"}
org.slf4j/slf4j-simple {:mvn/version "2.0.7"}
}
}
}}
- Replace
+with the specific version shown in the badge above.
Configure
Option 1—environment variables (recommended)
export ATLAN_BASE_URL=https://tenant.atlan.com
export ATLAN_API_KEY="<your-api-token>"
(ns my.proj
(:import com.atlan.AtlanClient)
(:require [clojure.tools.logging :as logger]))
(defn -main [& args]
(with-open [client (AtlanClient.)]
(logger/info "Client ready")))
Option 2—client constructor
(defn -main [& args]
(with-open [client (AtlanClient. "https://tenant.atlan.com" "<your-api-token>")]
(logger/info "Client ready")))
The Go SDK is experimental. Breaking changes may occur without notice. Feedback is welcome—see the GitHub repo.
Install
go get github.com/atlanhq/atlan-go
Configure
Option 1—environment variables (recommended)
export ATLAN_BASE_URL=https://tenant.atlan.com
export ATLAN_API_KEY="<your-api-token>"
package main
import "github.com/atlanhq/atlan-go/atlan/assets"
func main() {
client := assets.NewContext()
// client is ready
}
Option 2—client constructor
package main
import "github.com/atlanhq/atlan-go/atlan/assets"
func main() {
client := assets.NewContext(
assets.WithBaseURL("https://tenant.atlan.com"),
assets.WithAPIKey("<your-api-token>"),
)
// client is ready
}
The Atlan CLI is in closed preview. Contact your Atlan Customer Success Manager to request access. Installation is subject to Product Release Stage terms.
Use the Atlan CLI to manage data contracts and sync metadata for a limited set of asset types.
Install
- Homebrew (recommended)
- macOS (Apple silicon)
- macOS (Intel)
- Linux
- Windows
brew tap atlanhq/atlan
brew install atlan
Homebrew keeps the CLI up-to-date with brew upgrade atlan.
curl -o atlan.tgz -L https://github.com/atlanhq/atlan-cli-releases/releases/latest/download/atlan_Darwin_arm64.tar.gz
tar xf atlan.tgz
curl -o atlan.tgz -L https://github.com/atlanhq/atlan-cli-releases/releases/latest/download/atlan_Darwin_amd64.tar.gz
tar xf atlan.tgz
curl -o atlan.tgz -L https://github.com/atlanhq/atlan-cli-releases/releases/latest/download/atlan_Linux_amd64.tar.gz
tar -zxf atlan.tgz
curl -o atlan.zip -L https://github.com/atlanhq/atlan-cli-releases/releases/latest/download/atlan_Windows_amd64.zip
unzip atlan.zip
Configure
Create .atlan/config.yaml in your home directory:
atlan_api_key: "<your-api-token>" # (1)
atlan_base_url: https://tenant.atlan.com # (2)
log:
enabled: false # (3)
level: info
- An API token with access to your assets.
- The base URL of your tenant, including
https://. - Set to
trueto enable verbose logging.
Alternatively, set ATLAN_API_KEY as an environment variable—it takes precedence over the config file.
Define data sources (required for data contract operations):
data_source snowflake: # (1)
type: snowflake
connection:
name: snowflake-prod
qualified_name: "default/snowflake/1234567890"
database: db
schema: analytics
- Each data source definition starts with
data_sourcefollowed by a unique reference name.
See it in action in our automated enrichment course (45 mins).
No installation required. Use dbt's meta field to enrich metadata from your dbt project directly into Atlan.
How it works
Add an atlan block inside meta on any model or column:
version: 2
models:
- name: customers
description: >-
This table has basic information about a customer.
meta:
atlan:
attributes: # (1)
certificateStatus: DRAFT
ownerUsers: ["bryan", "ashwin"]
classifications: # (2)
- typeName: "ipubxAPPb0zRcNU1Gkjs9b"
propagate: true
removePropagationsOnEntityDelete: true
restrictPropagationThroughLineage: true
restrictPropagationThroughHierarchy: false
columns:
- name: customer_id
description: Unique identifier for a customer.
- name: total_order_amount
meta:
atlan: # (3)
attributes:
certificateStatus: DRAFT
ownerUsers: ["ravi"]
- Set asset attributes such as certificates, announcements, and owners inside
attributes. - Apply classifications inside
classifications. - The same
metastructure applies to columns within a model.
For field-by-field examples, look for the dbt tab in the asset how-tos.
Atlan emits events when metadata changes—asset created, updated, tagged, lineage added, and more. Tap into these in a push-based model to take action the moment they occur.
How it works
- Set up a webhook in Atlan to receive event payloads.
- Implement an event handler using the Python or Java SDK.
See event handling how-tos for implementation details, including AWS Lambda deployment.
Direct REST API usage requires deep knowledge of Atlan's payload structures, enumeration values, and HTTP conventions. We strongly recommend using an SDK instead.
All SDKs communicate through the same REST API and encode the best practices for you. If you want to use the SDKs, start with the Python or Java tabs above.
Postman
For initial experimentation, use Postman. Look for the Raw REST API tab on any how-to page for the endpoint URL and example payload.
OpenAPI spec
We don't publish a usable OpenAPI spec. We attempted generated clients but found that generators dropped significant portions of payload data and produced cumbersome object hierarchies. We maintain the SDKs directly instead.
If you use raw REST APIs rather than an SDK, share your use case—we'd love to understand why.