POST
/
v1
/
users
/
{userId}
/
data-sources
curl --request POST \
  --url https://wmc.wiremockapi.cloud/v1/users/{userId}/data-sources \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "dataSource": {
    "name": "My data source",
    "type": "CSV",
    "columnsMetadata": [
      {
        "name": "fullname",
        "type": {
          "name": "STRING"
        }
      },
      {
        "name": "dob",
        "type": {
          "name": "DATE",
          "format": "iso8601"
        }
      },
      {
        "name": "admin",
        "type": {
          "name": "BOOLEAN"
        }
      },
      {
        "name": "retryLimit",
        "type": {
          "name": "INTEGER"
        }
      }
    ],
    "rows": [
      [
        "Alice S",
        "1975-05-31",
        "true",
        "3"
      ],
      [
        "Bob B",
        "1959-11-16",
        "false",
        "1"
      ],
      [
        "Sam M",
        "1999-07-02",
        "false",
        "0"
      ]
    ]
  }
}'
{
  "dataSource": {
    "id": "abc123",
    "aclObject": "jkl789",
    "name": "My data source",
    "lastUpdatedTime": "2024-01-17T11:46:13.481826Z",
    "version": 3,
    "type": "CSV",
    "columnsMetadata": [
      {
        "name": "fullname",
        "type": {
          "name": "STRING"
        }
      },
      {
        "name": "dob",
        "type": {
          "name": "DATE",
          "format": "iso8601"
        }
      },
      {
        "name": "admin",
        "type": {
          "name": "BOOLEAN"
        }
      },
      {
        "name": "retryLimit",
        "type": {
          "name": "INTEGER"
        }
      }
    ],
    "state": "ENABLED",
    "links": {
      "self": "/v1/data-sources/abc123",
      "acl": "/v1/data-sources/abc123/acl{?subjectId}"
    }
  }
}

Authorizations

Authorization
string
headerrequired

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

userId
string
required

Body

application/json
dataSource
object
required

Response

201 - application/json
dataSource
object
required