The remote doctype should be created in the cozy repo : [https://github.com/cozy/cozy-doctypes](https://github.com/cozy/cozy-doctypes)
## Remote doctype org.ecolyo.usage
To create the remote the first create a folder named 'org.ecolyo.usage' and then add a file name request in the folder.
Here is the structure of the file:
```bash
POST https://API_URL
Content-Type: application/json
{{data}}
```
## Local remote doctype
As the doctype if not yet avaible on cozy repo, we first need to test it on local. For that we can use the *—doctypes* command in the cozy-stack serve and use it to point to a local repo.
Here are the step:
- clone the repo and add it in the ecolyo repo
- create the remote doctype. Here we create a new folder named 'org.ecolyo.usage' and add the following request file (replace API_URL by the url of the API):
```bash
POST https://API_URL
Content-Type: application/json
{{data}}
```
- add the *—doctypes* command in the "docker/cozy-app-dev-with-app.sh" file and also the *-remote-allow-custom-port* flag
```bash
${COZY_STACK_PATH} serve --allow-root\
--appdir"${appdir}"\
--host"::"\
--port"${COZY_STACK_PORT}"\
--admin-port"${COZY_STACK_ADMIN_PORT}"\
--couchdb-url"${COUCHDB_URL}"\
--doctypes /data/cozy-doctypes \
--mail-port 1025 \
--mail-disable-tls\
--remote-allow-custom-port\
--fs-url"file://localhost${vfsdir}" &
```
- add the following content in "docker/disableCSP.yaml":
- tag the image to [registry.forge.grandlyon.com/web-et-numerique/llle_project/ecolyo/cozy-env](http://registry.forge.grandlyon.com/web-et-numerique/llle_project/ecolyo/cozy-env)
- add the following command to winstack script in the package.json:
```yaml
-v $PWD/cozy-doctypes:/data/cozy-doctypes
```
- start the server with the new image:
```bash
yarn winstack
```
- Change the content request param in io.cozy.doctypes/org.ecolyo.usage using the db tool ([http://localhost:5984/_utils](http://localhost:5984/_utils)):