> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Add dbt metadata for a connection

POST https://api.sigmacomputing.com/v2/connections/{connectionId}/dbtArtifacts
Content-Type: multipart/form-data

Add dbt run artifacts for a given connection. For more details, see [Configure dbt Core integration](/docs/manage-dbt-integration#configure-dbt-core-integration-beta).

  ### Usage notes
  - Retrieve the **connectionId** by calling the [/v2/connections](https://help.sigmacomputing.com/reference/list-connections) endpoint.
  - Create a tar.gz file containing the target directory of your dbt project that contains run artifacts.
  - Provide the file in the request with the field name 'artifacts'.
    

Reference: https://help.sigmacomputing.com/reference/post-connection-dbt-artifacts

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: sigma-rest-api
  version: 1.0.0
paths:
  /v2/connections/{connectionId}/dbtArtifacts:
    post:
      operationId: postConnectionDbtArtifacts
      summary: Add dbt metadata for a connection
      description: >-
        Add dbt run artifacts for a given connection. For more details, see
        [Configure dbt Core
        integration](/docs/manage-dbt-integration#configure-dbt-core-integration-beta).

          ### Usage notes
          - Retrieve the **connectionId** by calling the [/v2/connections](https://help.sigmacomputing.com/reference/list-connections) endpoint.
          - Create a tar.gz file containing the target directory of your dbt project that contains run artifacts.
          - Provide the file in the request with the field name 'artifacts'.
            
      tags:
        - Connections
      parameters:
        - name: connectionId
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: OAuth authentication
          required: true
          schema:
            type: string
      responses:
        '201':
          description: The response body.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/connections_postConnectionDbtArtifacts_Response_201
      requestBody:
        description: The request body.
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                artifacts:
                  type: string
                  format: binary
                  description: >-
                    Compressed (tar.gz) file containing the artifacts of a dbt
                    run.
              required:
                - artifacts
servers:
  - url: https://api.sigmacomputing.com
    description: Server for GCP (US) hosted organizations
  - url: https://api.sa.gcp.sigmacomputing.com
    description: Server for GCP (KSA) hosted organizations
  - url: https://aws-api.sigmacomputing.com
    description: Server for AWS US (West) hosted organizations
  - url: https://api.us-a.aws.sigmacomputing.com
    description: Server for AWS US (East) hosted organizations
  - url: https://api.ca.aws.sigmacomputing.com
    description: Server for AWS Canada hosted organizations
  - url: https://api.eu.aws.sigmacomputing.com
    description: Server for AWS Europe hosted organizations
  - url: https://api.au.aws.sigmacomputing.com
    description: Server for AWS Australia and APAC hosted organizations
  - url: https://api.uk.aws.sigmacomputing.com
    description: Server for AWS UK hosted organizations
  - url: https://api.us.azure.sigmacomputing.com
    description: Server for Azure US hosted organizations
  - url: https://api.eu.azure.sigmacomputing.com
    description: Server for Azure Europe hosted organizations
  - url: https://api.ca.azure.sigmacomputing.com
    description: Server for Azure Canada hosted organizations
  - url: https://api.uk.azure.sigmacomputing.com
    description: Server for Azure United Kingdom hosted organizations
  - url: https://api.au.azure.sigmacomputing.com
    description: Server for Azure Australia hosted organizations
components:
  schemas:
    connections_postConnectionDbtArtifacts_Response_201:
      type: object
      properties: {}
      title: connections_postConnectionDbtArtifacts_Response_201
  securitySchemes:
    OAuth:
      type: http
      scheme: bearer
      description: OAuth 2.0 authentication

```

## Examples



**Request**

```json
{
  "artifacts": "<file: dbt_run_artifacts.tar.gz>"
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://api.sigmacomputing.com/v2/connections/connectionId/dbtArtifacts"

files = { "artifacts": "open('dbt_run_artifacts.tar.gz', 'rb')" }
headers = {"Authorization": "<token>."}

response = requests.post(url, files=files, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.sigmacomputing.com/v2/connections/connectionId/dbtArtifacts';
const form = new FormData();
form.append('artifacts', 'dbt_run_artifacts.tar.gz');

const options = {method: 'POST', headers: {Authorization: '<token>.'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sigmacomputing.com/v2/connections/connectionId/dbtArtifacts"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"artifacts\"; filename=\"dbt_run_artifacts.tar.gz\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<token>.")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.sigmacomputing.com/v2/connections/connectionId/dbtArtifacts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<token>.'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"artifacts\"; filename=\"dbt_run_artifacts.tar.gz\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.sigmacomputing.com/v2/connections/connectionId/dbtArtifacts")
  .header("Authorization", "<token>.")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"artifacts\"; filename=\"dbt_run_artifacts.tar.gz\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sigmacomputing.com/v2/connections/connectionId/dbtArtifacts', [
  'multipart' => [
    [
        'name' => 'artifacts',
        'filename' => 'dbt_run_artifacts.tar.gz',
        'contents' => null
    ]
  ]
  'headers' => [
    'Authorization' => '<token>.',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.sigmacomputing.com/v2/connections/connectionId/dbtArtifacts");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<token>.");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"artifacts\"; filename=\"dbt_run_artifacts.tar.gz\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "<token>."]
let parameters = [
  [
    "name": "artifacts",
    "fileName": "dbt_run_artifacts.tar.gz"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/connections/connectionId/dbtArtifacts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```