# Schema APIs

Schema Service enables schema management in the Data Platform and offers an
implementation of the schema standard.

Schema Service handles schema life cycle to help with the development of schemas in the Ecosystem.

```plain {% title="Client ID" %}
963f2cc6915e479fa0fcb73ec2ec90e7
```

## Schema States

This lifecycle consists of three states - "DEVELOPMENT", "PUBLISHED" and "OBSOLETE".

* `DEVELOPMENT` - Denotes that a Schema is in draft or evolutionary phase. Schema in this state is mutable.

* `PUBLISHED` - A Schema can directly be created in published state or moved from the DEVELOPMENT state to the PUBLISHED state. A Schema in published state is immutable.

* `OBSOLETE` - Schema can be marked as obsolete once they are no more in use. You can change DEVELOPMENT state schemas to OBSOLETE state.

## Schema Scopes

* `INTERNAL` - A schema defined in a certain data partition and accessible to only the users of that data partition is said to have "INTERNAL" scope.

* `SHARED` - The Managed Planning Data Foundation makes certain standard schema available out of the box to all OSDU data partitions. These schema will have scope as "SHARED" by default and it should be created using system endpoint.


Version: 1.0.0

## Servers

SLB Saas OSDU (SGP)
```
https://as5.api.enterprisedata.slb.com/api/schema-service/v1
```

SLB SaaS OSDU (BRS)
```
https://br5.api.enterprisedata.slb.com/api/schema-service/v1
```

SLB Saas OSDU (WEU)
```
https://eu5.api.enterprisedata.slb.com/api/schema-service/v1
```

SLB SaaS OSDU (EUT)
```
https://eu6.api.enterprisedata.slb.com/api/schema-service/v1
```

SLB Saas OSDU (MDE)
```
https://eu7.api.enterprisedata.slb.com/api/schema-service/v1
```

SLB Saas OSDU (PSC)
```
https://us5.api.enterprisedata.slb.com/api/schema-service/v1
```

SLB Saas OSDU (USC)
```
https://us7.api.enterprisedata.slb.com/api/schema-service/v1
```

SLB Saas OSDU (WUS)
```
https://us8.api.enterprisedata.slb.com/api/schema-service/v1
```

SLB Saas OSDU (SAS)
```
https://as6.api.enterprisedata.slb.com/api/schema-service/v1
```

SLB Saas OSDU (SWC)
```
https://eu8.api.enterprisedata.slb.com/api/schema-service/v1
```

SLB Saas OSDU (MYW)
```
https://as7.api.enterprisedata.slb.com/api/schema-service/v1
```

SLB Saas OSDU (ZAN)
```
https://za1.api.enterprisedata.slb.com/api/schema-service/v1
```

## Security

### bearer

User Token from SLB Authenticator Service

Type: http
Scheme: bearer
Bearer Format: JWT

## Download OpenAPI description

 - [Schema APIs](https://developer.slb.com/_bundle/solutions/core-service/apis/OSDU-Schema-Service.yaml)

## Schema

 - [POST /schema](https://developer.slb.com/solutions/core-service/apis/osdu-schema-service/schema/create%20schema.md): Adds a schema to the schema repository. The schemaIdentity must be unique. The `authority`, `source` and `entityType` will be registered if not present. If lower minor versions are registered the serv
 - [PUT /schema](https://developer.slb.com/solutions/core-service/apis/osdu-schema-service/schema/update%20schema.md): Creates a new schema or updates an already existing schema with status `DEVELOPMENT` in the schema repository. If a user tries to create/update a schema with status other then `DEVELOPMENT`, API will
 - [GET /schema](https://developer.slb.com/solutions/core-service/apis/osdu-schema-service/schema/searchschemainforepository.md): The API returns a list of all schemas in the specific {data-partition-Id} and the list of available shared schemas in chronological order based on "dateCreated". If filter criteria is specific then th
 - [GET /schema/{id}](https://developer.slb.com/solutions/core-service/apis/osdu-schema-service/schema/get%20schema.md): Retrieve a schema using its system defined id. Required roles 'users.datalake.viewers' or 'users.datalake.editors' or 'users.datalake.admins' groups to get the schema.
## Shared Schema

 - [PUT /schemas/system](https://developer.slb.com/solutions/core-service/apis/osdu-schema-service/shared-schema/update%20system%20schema.md): This endpoint allows user to a create schema with all possible states i.e. DEVELOPMENT,PUBLISHED or OBSOLETE but update can be used only on schemas that are in "DEVELOPMENT" state. A schema status can
## Info

 - [GET /info](https://developer.slb.com/solutions/core-service/apis/osdu-schema-service/info/version%20info.md): For deployment available public `/info` endpoint, which provides build and git related information.
